WaitWindowOpen

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
GalaxyMan
Junior Coder
Posts: 40
Joined: Sat Jun 27, 2009 7:21 pm

WaitWindowOpen

Post by GalaxyMan » Sun Jul 12, 2009 10:51 am

If I want to be able to use a macro on various different computers, is it possible to drop the last two lines of this code and have the essence of it waiting for the window to open still be effective?

WaitWindowOpen>Blank Window
MoveWindow>Blank Window,709,199
ResizeWindow>Blank Window,670,300

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Jul 12, 2009 11:28 am

The answer is "it depends what the rest of your macro does". If your macro uses absolute screen coordinates to move the mouse etc then, no, if you remove those lines the macro will most likely fail.

However, if you have coded your macro a bit more intelligently by avoiding mouse clicks, using keyboard shortcuts, or - where mouse clicks are the only way - you have used relative mouse coordinates, or image recognition* to find the position, then, yes, you can probably remove those lines.

*if you've used image recognition then of course you will also have to consider the differences in screen color depth etc and distribute the needle images with the script.

These articles should help:
http://www.mjtnet.com/blog/2008/10/27/t ... le-macros/
http://www.mjtnet.com/blog/2006/01/16/k ... shortcuts/
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
GalaxyMan
Junior Coder
Posts: 40
Joined: Sat Jun 27, 2009 7:21 pm

Post by GalaxyMan » Sun Jul 12, 2009 11:37 am

Thanks, Marcus.

It actually worked very nicely because the default focus was where I wanted to next input something, so there was no need for any mouse coordinates or anything of that sort following the WaitWindowOpen.

Does the WaitWindowOpen work in a browser where you want the entire page to load before the next step occurs?

For example, the 'name' of the tab which is displaying this page right now for me is: Windows Scripting, Windows Macro Automation, Windows Macro Recorder - Automate your PC for Windows 9x/NT/ME/2000/XP/Vista :: Post a reply. Would I have to use all of that to tell it which 'window' to wait for, even though it's a tab on the browser(Firefox)?

Thanks again...

Ronen

User avatar
GalaxyMan
Junior Coder
Posts: 40
Joined: Sat Jun 27, 2009 7:21 pm

Post by GalaxyMan » Sun Jul 12, 2009 11:38 am

Or must I tell it the Window name as well as the Tab name?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Jul 12, 2009 11:47 am

Most web browsers display the title of the page in the browser's title bar *before* the page has finished loading. Therefore WaitWindowOpen will return before the page has loaded fully. Therefore, no, WaitWindowOpen is not sufficient when waiting for a web page to load.

For web pages you can either use WebRecorder which has the WaitIE function which knows when a page has finished loading, or use WaitScreenText or WaitScreenImage to wait until something visual appears on the screen (in the page) that signifies to you that the page has loaded (this is what a human does).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
GalaxyMan
Junior Coder
Posts: 40
Joined: Sat Jun 27, 2009 7:21 pm

Post by GalaxyMan » Sun Jul 12, 2009 12:27 pm

I don't seem to find WebRecorder...

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

WebRecorder is a separate product

Post by gdyvig » Sun Jul 12, 2009 2:32 pm

Hi Ronen,

WebRecorder is a separate add-on MJTNET product that works with Macro Scheduler. It is bundled with the enterprise version of Macro Scheduler or may be purchased separately.

Gale

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts