Browse the docs

Read or save the images of an app's window

Lists the images in a window with their descriptions, and saves the visible ones as PNG files.

Save the images of locator to save

Details #

Lists every image at least minSize points square (32 by default) in the front window of app, or under locator, each as {description, frame, path?}. The description is the image's accessibility description (its alt text). into receives the list.

Accessibility never gives pixels, so with save (a folder, created if needed) the step takes one screenshot of the window and crops each visible image out of it as a PNG named <app>-<n>-<description>.png. An image that is not fully inside the window is listed with offscreen: true and no path, and the step's note says how many.

Saving needs the Screen Recording permission; without it the step fails with the permission's words. Listing does not.

In a dry run nothing is saved.

Parameters #

ParameterTypeRequiredValuesWhat it does
apptext, locator, fuzzy, into.
fuzzyyes / no
intotext
locatorlocator
minSizenumberPoints square; smaller images are skipped.
sampleany value
savetextThe folder to save into.

Every step also accepts label, onFailure, timeout and dryRunSafe.

Examples #

Save the images in this window
Do
  1. Save the images of the front window to “~/Pictures/Switchboard”
  2. Show “Saved {{ length(pics) }} images” for 2 s
Open in Switchboard to try it

Gotchas #

  • Images are cropped from a screenshot, so something covering the window (another window, a menu) is in the picture. Bring the window to the front first.

  • A dry run skips this step unless you mark it Safe in dry run, and then still saves nothing.

See also #

Read the links of an app's window, Read the rows of an app's list, Read text on screen