When running an application with Run Program the next thing you are almost always going to want to do is make sure that the application is ready to accept input. 99.9% of the time we do this with the WaitWindowOpen command, e.g.:
Run Program>notepad.exe
WaitWindowOpen>Untitled - Notepad
Another example:
Run Program>iexplore.exe
WaitWindowOpen>Microsoft Internet Explorer*
The WaitWindowOpen command will pause the script until the specified window is present and open. Now, if sending any keyboard or mouse events they will get to the window at the right time, where before they may have been sent too early.
When recording a macro and specifying an application to run first you will notice that the generated code has automatically had the Run Program and WaitWindowOpen commands added. The Macro Recorder also adds in some code to position and size the window in the same place it appeared when the recording was made - to ensure that any mouse events you subsequently recorded will land on the right place in the window.
Use WaitWindowOpen after Run Program
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Use WaitWindowOpen after Run Program
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?