Help with WaitRectChanged

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

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 » Sun Jul 17, 2011 12:20 pm

I'm trying to streamline one of my scripts that wait for a process to complete
and refresh a window. I was looking at using WaitRectChanged in a loop.
But I can't figure out how to get the Rectangle coordinates I need for the command.

Thanks in advance for your help

Gil

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Mon Jul 18, 2011 7:22 pm

Well, one way (there are several) is to use the
real-time pixel coordinate tool on the tool bar
of the macro editor. It's over on the right and
can be set to readout in relative or absolute X/Y
numbers.

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

Post by gchichester » Wed Jul 27, 2011 8:17 pm

Thanks
Are you referring to the mouse coordinate box with the drop down on it?
with Relative, follow cursor, Pixel Color
Because I don't see any other tool.
If you are then what about the x2 & y2 coordinate that WaitRectChange needs

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Wed Jul 27, 2011 9:08 pm

Are you referring to the mouse coordinate box with the drop down on it? with Relative, follow cursor, Pixel Color
Yes. Make sure Relative is unchecked because WaitRectChanged uses absolute coordinates.
From the Help File ......
WaitRectChanged>TLX,TLY,BRX,BRY,Timeout

This command causes Macro Scheduler to wait until the image bound by the specified pixel coordinates changes. If it doesn't change within the number of seconds specified in Timeout, the command stops waiting and the variable WRC_RESULT is set to FALSE. WRC_RESULT is TRUE if the command terminated because the image changed within the specified time. if Timeout is set to 0, the command will wait indefinitely.

TLX - Top Left corner X coordinate
TLY - Top Left corner Y coordinate
BRX - Bottom Right corner X coordinate
BRY - Bottom Right corner Y coordinate
Position the cursor at the top left corner of where the rectangle begins, and read off the coordinates. Next position the cursor at the bottom right corner of the imaginary rectangle, and read off the coordinates again.

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