Skip to main content

Click image

Find a picture on the screen (optionally waiting for it, in a region, or its n-th appearance) and click it with the chosen button at its centre, corner or an offset.

Command in the Image recognition toolkit · id ooa.image/click_image · 14 inputs (1 required), 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
TemplateFileYesPicture to click.
Double-clickBooleanNofalseDouble-click.
ToleranceNumberNo10Allowed difference in percent (0 = pixel-exact); raise for anti-aliased or scaled screens.
ButtonStringNoleftMouse button to click with.
OccurrenceNumberNo1Which match to use when the picture appears several times, counting in reading order from 1.
PositionStringNocenterPoint reported (and clicked): center of the match, or its top_left corner; offsets are added to it.
Offset xNumberNo0Pixels added to the reported x, e.g. to reach a field to the right of a label picture.
Offset yNumberNo0Pixels added to the reported y.
Timeout (seconds)NumberNo0Keep looking for up to this many seconds before failing; 0 looks once.
XNumberNoSearch region left; the whole image or screen when the region is empty.
YNumberNoSearch region top.
WidthNumberNoSearch region width.
HeightNumberNoSearch region height.
WindowStringNoLook only inside this window (text in its title, * and ?, or re:); x and y then count from its top-left corner (G4).

Outputs​

OutputTypeWhat it is
xNumberClicked x.
yNumberClicked y.