Browse the docs

Image found

Passes when a saved picture appears on the screen or in the front window.

image is on the screen

Keyboard Maestro: ScreenImage (Contains, DoesNotContain)

Details #

Captures the screen (or the front window) and searches it for your picture. It passes when the best match scores at or above threshold. Name the picture with image, or put the same keys in a locator with role image. A name is looked up in the image library; a path starting with / is used as is.

threshold runs from 0.3 to 0.99 and defaults to 0.85. scope is screen (default) or window. pick chooses between several matches: best (default), top, bottom, left, right.

Every condition accepts "negate": true, which flips the verdict. The trace records what was compared before the flip, so a negated condition that blocks a macro still shows the real values.

Conditions in an Only if list combine with all: every one must pass, and an empty list always passes. An if step or a repeat loop takes a match of all (default) or any.

The trace shows found, score, threshold, and the match position x and y when found. A miss still records the closest score, which helps when tuning threshold.

In a dry run nothing is captured. The condition answers with sample (default true) and the trace shows simulated.

Parameters #

ParameterTypeRequiredValuesWhat it does
imagetextLibrary name or absolute path.
locatorlocator
pickone ofbest top bottom left right
sampleyes / noThe answer used in a dry run.
scopeone ofscreen window
thresholdnumber
uniqueyes / no

Examples #

Only if the play button is visible
When
  1. Press ⌃⌥J
Only if
  1. If ‹image› is on the screen
Do
  1. Show “Play button on screen”
Open in Switchboard to try it

Gotchas #

See also #