Wait - For pixel

Declaration

<AMWAIT ACTIVITY="pixel" XPOS="number" YPOS="number" COLOR="number" />

Related Topics    

Description

Causes task execution to pause at the current step until the specified pixels match or differ from the color values 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.

Parameters

General

Property Type Required Default Markup Description
Wait until Text (options) Yes Match
  • ACTION="match"
  • ACTION="differ"
  • ACTION="any"
The pixel condition to wait for. The available options are:
  • Pixel colors match - Wait until the pixel colors match the pixels specified in the corresponding XPOS, YPOS and COLOR parameter.
  • Pixel colors don't match - Wait until the pixel colors do not match all of the pixels specified in the corresponding XPOS, YPOS and COLOR parameter.
  • Pixel colors change - Wait until (at least one of) the pixels changes color from the colors of the specified pixels at the time the step begins execution.
XPos Number Yes (Empty) XPOS="36" The X coordinate of the pixels 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 pixels 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 colors 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

Error Causes

On Error

Examples

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Example 1

Wait for pixels to match.

Copy
<AMWAIT ACTIVITY="pixel" XPOS="260" YPOS="297" COLOR="16777215" />

Example 2

Wait for pixels to differ.

Copy
<AMWAIT ACTIVITY="pixel" WAITMODE="differ" XPOS="260" YPOS="297" COLOR="16777215" />

Example 3

Wait for pixels to change color.

Copy
<AMWAIT ACTIVITY="pixel" WAITMODE="any" XPOS="260" YPOS="297" />