# Record a desktop app

> Record a Mac app's window with vos record --app, by hand or from a click path.

Record a Mac app's window with `vos record --app`, the same way the CLI
records a page.

[VS Code driven by a script: a file opens, a few lines of code are typed, and the terminal runs them (live vos)](https://vos.so/vos/24eed070-eb91-485d-a497-702b1e3b3bc0)

![VS Code driven by a script: a file opens, a few lines of code are typed, and the terminal runs them](https://vos.so/api/vos/24eed070-eb91-485d-a497-702b1e3b3bc0/thumbnail)

```sh
vos record --app "Calculator" --out take
```

Use the app while it records, then press Ctrl-C. The window is recorded
alone, without the system pointer, and the pointer's path is saved beside
it. A take is a recording plus its cursor track and edits, so the studio
draws the cursor and plans zooms as it does for a page.

## Script it

Give it the same click path a page uses. A selector names a control by its
role and what it is called.

```sh
vos look --app "Calculator"
vos record --app "Calculator" --actions actions.json --out take --strict
```

`vos look` lists every control with one selector, such as
`button[id='Seven']`. A scripted take presses the real app with your pointer
and keyboard, so leave the machine alone until it ends. It stops at the
first step that misses.

## Record a copy, not your own window

Start a second copy of the app with its own profile and a scratch project,
and record that one by its process. `vos record --windows` lists each
window's process, and `--pid` picks it. An Electron app such as VS Code
needs `--force-renderer-accessibility` when it starts, or `vos look` finds
no controls.

## Something that answers back

A game needs a program, not a list of steps:

```sh
vos record --app "Google Chrome" --play play.mjs --out take
```

```js
export default async function (play, { window }) {
  await play.step('start', () => play.click("button[name='Play']"))
  await play.step('fly', async () => {
    // look, decide, act, as often as it takes
    await play.move(window.w / 2, window.h / 2, 12)
  }, { zoom: false })
}
```

`zoom: false` marks play: no zoom is proposed there.

## An app you are signed in to

When the app is your account, keep what is yours out of the picture with
`mask`:

```json
"mask": [{ "selector": "popup[name*='Account']" }]
```

Every match is covered before a frame is saved, so it is in no file. Have
it on screen before the take begins. A script that types into the app can
undo it with `teardown`, off camera.

This needs macOS 14 or later, with Screen Recording granted to the app your
terminal runs in, and Accessibility for a scripted take. `vos doctor` says
which are granted. Every flag is on [Verbs](/docs/cli/verbs), and the click
path's format on [actions.json](/docs/cli/actions-json).
