Help with Repeat/Until

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Help with Repeat/Until

Post by gchichester » Tue Feb 10, 2009 3:29 pm

The program I’m automating sends data over the internet and waits for a return,
but the screen doesn’t auto refresh , so I don’t know when to continue the script.
I’m using “WaitScreenImageâ€

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Refresh Screen

Post by kpassaur » Wed Feb 11, 2009 11:22 am

If I read this correctly you could just send F5 and then check the screen as F5 would refresh it and then you could compare it.

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Help with Repeat/Until

Post by gchichester » Wed Feb 11, 2009 11:54 am

I'm doing a screen refresh in the program with the Alt R and the Press Enter(see script)
The issue is not knowing how long it will take to get the data back.

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Wait Screen image

Post by kpassaur » Wed Feb 11, 2009 12:21 pm

Use WSI_TIMEOUT so it checks if it is not found it goes into a loop where you refresh the screen and try again.

So you have something like (untested)

Let>z=1
label>updateloop
Let>WSI_TIMEOUT=5
WaitScreenImage=C:\CP_Macros\JohnW\AES_ShipmentAdded.bmp,10
If>WSI_RESULT=0
If>z=10,tenattemps
Send>F5
Let>z=z+1
Goto>updateloop
Endif
Goto>matched
//ten attemps were made to read the screen with each attempt checking for 5 seconds
Label>tenattemps
MDL>no match
Label>matched

After 10 attemps or whatever it assumes that it is never going to be returned.

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