# screenshot

Save the screen as a PNG file.

```js
screenshot(pathOrOptions?)
```

## Arguments

| Argument | Type | Meaning |
| --- | --- | --- |
| `pathOrOptions` | string \| object | Optional 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](https://mcp.applesauceos.com/doc/api.md) · [Automation playbook](https://mcp.applesauceos.com/doc/ai.md)
