Returns the color of a single pixel on screen as a hex string.
Pixel X coordinate.
Pixel Y coordinate.
Hex color string, e.g. "#FF0000" for red.
Searches the screen for a template image loaded from the script asset sandbox or an explicitly user-selected file path. Uses masked normalized cross-correlation: transparent pixels in the template PNG are ignored, so only opaque regions (text, borders) contribute to the match score.
Script asset path, or an absolute path selected by a UI file/directory picker.
Optionalthreshold: numberMinimum correlation score to consider a match, between 0 and 1. Defaults to 0.8.
Optionalregion: WindowBoundsSearch region { x, y, width, height } in virtual screen coordinates. Omit to search all monitors.
An ImageMatchResult with the center coordinates and score, or null if no match meets the threshold.
ALWAYS check for null before accessing .x or .y. The return value is null when no match meets the threshold.
imagePath values are resolved canonically. Paths inside the script asset sandbox are accepted, and .. escapes are denied. Absolute paths outside the sandbox are accepted only when the path was selected by the user through UI.AddFilePicker or is inside a directory selected through UI.AddDirectoryPicker. Use FindImageBase64 when embedding a template directly in a script.
USE CASE: Pass a region from Window.Find() bounds to restrict the search area; this is significantly faster on multi-monitor setups.
const template = UI.AddFilePicker("save_button", "Save button template", { filters: ["png"] });
const match = Screen.FindImage(template.GetValue());
if (match) {
Mouse.Move(match.x, match.y);
Mouse.Click();
}
// Restrict search to a specific window's area
const [win] = Window.Find({ process: "chrome.exe" });
const match2 = Screen.FindImage(template.GetValue(), 0.9, win.bounds);
Searches the screen for a template image provided as Base64-encoded PNG data. Transparent pixels are masked out; only opaque regions contribute to the score.
Base64-encoded PNG image data with transparent background.
Optionalthreshold: numberMinimum correlation score to consider a match, between 0 and 1. Defaults to 0.8.
Optionalregion: WindowBoundsSearch region { x, y, width, height } in virtual screen coordinates. Omit to search all monitors.
An ImageMatchResult with the center coordinates and score, or null if no match meets the threshold.
ALWAYS check for null before accessing .x or .y.
USE CASE: Embed template images directly in the script without relying on external files. Encode the PNG to Base64 once and store as a constant.