Wait - For Pixel
Declaration
<AMWAIT ACTIVITY="pixel" XPOS="number" YPOS="number" COLOR="number" />
Description: Causes task execution to pause at the current step until the specified pixel(s) match or differ from the color value(s) specified.
Practical Usage
Commonly used to wait for a graphic or area of the screen to match (or stop matching) a "checksum" of pixel colors. Very useful for detecting subtle changes in a window's contents that cannot be measure by any other means. In visual mode, it is easy to create the checksum values, while in the properties of the action, simply move the mouse pointer around the target window while repeatedly pressing the INSERT key.
General Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Wait until |
Text (options) |
Yes |
Match |
|
The pixel condition to wait for. The available options are:
|
XPos |
Number |
Yes |
(Empty) |
XPOS="36" |
The X coordinate of the pixel(s) to watch for. To select a pixel/color pair, press Add, hover the mouse cursor over the desired area and hit the INSERT key. This capture's the pixel's X/Y position and color and populates the values onto the List of pixels grid. Multiple pixels/color pairs may be specified. Note: All parameters must have the same number of items specified (unless the Wait until parameter is set to Pixel colors change, in which case, color is omitted). |
YPos |
Number |
Yes |
(Empty) |
YPOS="38" |
The Y coordinate of the pixel(s) to watch for. To select a pixel/color pair, press Add, hover the mouse cursor over the desired area and hit the INSERT key. This capture's the pixel's X/Y position and color and populates the values onto the List of pixels grid. Multiple pixels/color pairs may be specified. Note: All parameters must have the same number of items specified (unless the Wait until parameter is set to Pixel colors change, in which case, color is omitted). |
Color |
Number |
Yes |
(Empty) |
COLOR="13160660" |
The color(s) that the corresponding pixels specified in XPOS and YPOS should contain. Multiple pixels/color pairs may be specified. Move the cursor to the desired area and press the INSERT key to capture an X/Y position and color. All parameters must have the same number of items specified (unless the Action parameter is set to Wait for pixels to change color, in which case, color is omitted). |
Coordinates relative to foreground window/screen |
Yes/No |
No |
Yes |
RELATIVE="NO" |
Specifies whether pixel coordinates should be relative to the foreground window (the window in front of all other windows on the desktop) or the full size of the screen. |
Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.
Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)
On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)
Examples
The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.
Sample 1: Wait for pixels to match.
<AMWAITFORPIXEL XPOS="260" YPOS="297" COLOR="16777215" />
Sample 2: Wait for pixels to differ.
<AMWAITFORPIXEL ACTION="differ" XPOS="260" YPOS="297" COLOR="16777215" />
Sample 3: Wait for pixels to change color.
<AMWAITFORPIXEL ACTION="any" XPOS="260" YPOS="297" />