Branch Point - WaitWindowOpen

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Rory
Pro Scripter
Posts: 50
Joined: Thu Mar 23, 2006 2:50 pm
Location: Wisconsin

Branch Point - WaitWindowOpen

Post by Rory » Mon May 08, 2006 6:26 pm

I have an application where I need to run a report and I am using MS to automate filling in the fields where needed by reading a text file (ReadLn).
Once the report is generating, I need to wait for one of two windows to open. One is a print window and the other tells me that there was no data available.
How can I have MS wait for one or the other window to open.
If I use "WaitWindowpen>Print", and the other one appears titled "Continue", MS sits and waits for the "Print" window.

Rory

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Mon May 08, 2006 6:36 pm

Use a loop (include a short wait) with two IfWindowOpen> statements to check for both window titles and branch as appropriate. You probably want to set a max number for passes round the loop as a timeout in case neither window ever appears.

Rory
Pro Scripter
Posts: 50
Joined: Thu Mar 23, 2006 2:50 pm
Location: Wisconsin

Post by Rory » Mon May 08, 2006 7:42 pm

I created a loop with a timer and counter. If neither window opens in the allotted amount of time, then the script quits runing.

Thanks for your help.

Rory


Let>j=1
Label>Again
IfWindowOpen>TCM Print
GOTO>PressOn
ELSE
IfWindowOpen>Continue
Press Enter
Wait>Idle
GOTO>start
ELSE
Wait>1
If>j=1800
GOTO>finish
ELSE
Let>j=j+1
GOTO>Again
ENDIF
ENDIF
Label>PressOn

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Mon May 08, 2006 8:57 pm

Good job!

You don't need the ELSE because if the condition isn't satisfied it will just drop to the next line anyway.

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