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 #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
app | text | , locator, fuzzy, into. | ||
fuzzy | yes / no | |||
into | text | |||
locator | locator | |||
minSize | number | Points square; smaller images are skipped. | ||
sample | any value | |||
save | text | The folder to save into. |
Every step also accepts label, onFailure, timeout and dryRunSafe.
Examples #
- Save the images of the front window to “~/Pictures/Switchboard”
- Show “Saved {{ length(pics) }} images” for 2 s
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