[AccessD] Automate internet speed test

jwcolby jwcolby at colbyconsulting.com
Mon Nov 5 01:23:12 CST 2007


I got it!  Boy was THAT easy.  It took about 1 hour from download to
finished script.  It's crude but it works.

The finished script looks like:

Run("C:\Program Files\Mozilla Firefox\firefox.exe")
WinWaitActive("Mozilla Firefox Start Page - Mozilla Firefox")
MouseClick("left",692,95)
sleep(10000)
;mouseclick("left",356,136)
;V=136+251=387
;H=356+263=619
mouseclick("left",619,397)

Basically the Window Info tool tells you the H/V offsets of the window,
which you add on to the position within the window.

Thanks a million for pointing out this tool, it works a treat as our
brethren across the pond would say.  

John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Monday, November 05, 2007 2:08 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Automate internet speed test

This is way cool.  However I am running into an issue setting the focus to
the active window (the flash control).  The window info tool tells me it is
"MozillaWindowClass8" but I am trying things like 

Run("C:\Program Files\Mozilla Firefox\firefox.exe")
;mousemove(692,90)
WinWaitActive("Mozilla Firefox Start Page - Mozilla Firefox")
MouseClick("left",692,95)
sleep(5000)
WinActivate("MozillaWindowClass8")
WinWaitActive("MozillaWindowClass8")
mouseclick("left",356,136)

and it gets all the way to opening the window and waiting for the flash to
stabilize but it does not activate that MozillaWindowClass8.  IOW the final
mouse click moves relative to the firefox bookmark bar at the top of
firefox, not relative to the boundaries of the flash control.  I don't know
how to get an absolute position on the screen, the mouse position in the
window info tool keeps resetting as it moves into and out of sub windows
inside of firefox.

I continue to play but not sure if I will figure this one out.

this widget is really cool though.  It would be even cooler if it would
"record macros" like Excel for instance.  I find no way to do that. 


John W. Colby
Colby Consulting
www.ColbyConsulting.com
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Monday, November 05, 2007 12:28 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Automate internet speed test

On 4 Nov 2007 at 22:43, jwcolby wrote:

> 
> Is it possible to do what I want to do, to have a program that I write 
> open a web site and "click on" a specific location on the screen, or 
> by some other means to accomplish what I do with the mouse right now?
> 

AutoIt was original written to do just this sort of thing.

http://www.autoitscript.com/autoit3/

<quote>
AutoIt v3 is a freeware BASIC-like scripting language designed for
automating the Windows GUI and general scripting. It uses a combination of
simulated keystrokes, mouse movement and window/control manipulation in
order to automate tasks in a way not possible or reliable with other
languages (e.g. VBScript and SendKeys). 
AutoIt is also very small, self-contained and will run on all versions of
Windows out-of-the-box with no annoying "runtimes" required!

AutoIt was initially designed for PC "roll out" situations to reliably
automate and configure thousands of PCs. Over time it has become a powerful
language that supports complex expressions, user functions, loops and
everything else that veteran scripters would expect </quote>


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list