Use of WaitWindowOpen, WaitReady, etc.

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Steve K

Use of WaitWindowOpen, WaitReady, etc.

Post by Steve K » Fri Nov 12, 2004 1:55 pm

I have been testing this product for about a week now so please bear with my rookie questions. I am having some trouble with the "WaitWindow" commands. I am using it to run a proprietary windows system and would feel more comfortable sending keystrokes after various window events, rather than just waiting for a specified number of seconds. Even though I have placed some WaitWindow commands in the code, it appears that the ensuing keystrokes are coming up too quickly and not producing the desired result. Here is the portion of the code affected:
remark>Wait>10
let>WW_Timeout=15
WaitWindowOpen>WinOPS - Operations Plus*
SetFocus>WinOPS - Operations Plus*
remark>Wait>5
WaitReady>0
press ALT
sen>r

The application displays a logo in the middle of the menu screen and the "r" is sent before the logo appears, causing nothing to happen. I have tried running MACRO with WaitReady>1, but then it seems to be waiting indefinitely for something to happen...and the "r" is never sent. There is also a small "Standby" screen that flashes by after the login and before the main menu screen appears. Could that be the issue? I also see that the menu scrren has a logo on the title bar, before the word "WinOPS". I don't know if that is causing an issue either. Help!!!

jalbt51
Junior Coder
Posts: 31
Joined: Sat Mar 06, 2004 4:40 pm

One beginner to another

Post by jalbt51 » Sat Nov 27, 2004 2:04 am

I'm a relative beginner, so these comments should be checked by someone who knows.

Have you already sent an ExecuteFile> command to open WinOPS - Operations Plus? WaitWindowOpen> only waits for the file you have previously Executed. I find the correct pathname for the ExecuteFile> command by opening "run" in my startmenue, going through "browse" until I find (for instance)C:\WINDOWS\notepad.exe(minus any quotes)This pathname needed for ExecuteFile> is different than the window title that will be needed for WaitReady>. That window title comes off of the window's title bar. Try:
ExecuteFile>
WaitReady>1
Wait>1.03
SetFocus>
Press Alt
Send>r

You may be able to get away without waitready if the Wait> time is long enough. I used the unusual 1.03 second wait to distinguish it from the WaitReady>1 which is not a specific unit of time.

I'm puzzled by remark>Wait>5. remark> will cause everything after it on that line to be ignored. It is for comments to yourself. I use a // at the beginning of the line for the same effect.

//This script demonstrates the use of // to deactivate everything on a line
//MessageModal>Sam Gamgee
Messagemodal>"Frodo"

The result of this script is the message, "Frodo"


I hope this helps. :)

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