ApplesauceOS
Read Markdown ↗Download .md

screenshot

Save the screen as a PNG file.

js
screenshot(pathOrOptions?)

Arguments

ArgumentTypeMeaning
pathOrOptionsstring | objectOptional absolute path or {savePath}; omitted overwrites the default screenshot.

Returns

Saved path string, or null on failure.

Example

js
const path = screenshot(__dirname + "/capture.png");
if (!path) throw new Error("Capture failed");
console.log(path);

All JavaScript APIs · Automation playbook