Help with WaitRectChanged

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 WaitRectChanged

Post by gchichester » Fri Sep 02, 2011 2:33 pm

Can anyone see a problem with code, the WaitRecChange is timing out,
the field I'm waiting on normally update in 45 sec. or less.
I'm having a hard time debugging because it's interacting with a program.

Thanks in advance for your help
Gil

[code]
GetScreenRes>sX,sY
ScreenCapture>0,0,%sX%,%sY%,c:\CP_Macros\Asia\AesShipmentAddedScreen.bmp
WaitRectChanged>628,460,853,473,60
Wait>0.5

Press Alt
SendText>o
Release Alt
Wait>0.5

//Waiting for a field to update, sending refresh command
Repeat
Press Alt
SendText>r
Release Alt
Wait>2
Until>WRC_Result=True
[/code]

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Sep 02, 2011 9:10 pm

Of course we don't know if you looking in the right place, but your WaitRectChanged> syntax is correct.

Once you get past whatever is causing it to hang, your Repeat> loop is going to fail. Two things.

- Your Repeat> line needs to include WRC_Result.
Repeat>WRC_Result

- Where are you acquiring a value for the variable "WRC_Result"? Nowhere in the snippet you've posted. And if you are in the repeat loop, how is "WRC_Result" value going to change to "True" so the loop can eventually end?

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

Post by gchichester » Sat Sep 03, 2011 12:33 pm

[quote]Where are you acquiring a value for the variable "WRC_Result"?[/quote]

I thought that when WaitRectChanged> sees a change it sets the variable WRC_Result to true ,based on what I read in the help file.
Are you saying that WRC_Result needs to be declared?
If so it not explained in help for the command .

As you can probably tell this is my first attempt at using a loop.
If there is a better way of testing the results of WaitRectChange please point me in the right direction.
Thank you in advance for all your help
Gil

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