# Control machines with Shortcuts and Siri

Use the Shortcuts app, Spotlight, or Siri to start, stop, and snapshot machines while the background service is on.

## Add a machine action to a shortcut

1. Open the Shortcuts app and create a shortcut.
2. In the action list, search for OSMates.
3. Drag **Start Machine** into the shortcut.
4. Click **Machine** and choose a machine.

The other actions are Shut Down Machine, Force Stop Machine, Suspend Machine, Take Snapshot, and Find Machines. The first four pass the machine on, so a shortcut can start a machine, then snapshot it.

**Start Machine** opens the machine's window. To start it in the background, expand the action and turn off **Open Window**. To wait until it runs commands, set **Wait Until** to **Its Guest Agent Answers**.

## Run an action from Spotlight or Siri

Say or type a phrase with your machine's name:

- "Start dev in OSMates"
- "Shut down dev in OSMates"
- "Suspend dev in OSMates"
- "Take a snapshot of dev in OSMates"

Siri and Spotlight learn the names of this Mac's machines, but not temporary ones.

## Know what an action does

Shut Down Machine turns off a guest still running 30 seconds after it was asked, so unsaved work is lost. Windows that installs updates gets up to 2 hours. The action waits up to 3 minutes, then says the machine is still shutting down.

Force Stop Machine always waits for your confirmation, so a shortcut that runs while nobody answers can't force a machine off.

**Take Snapshot** saves the machine's memory too, unless you turn off **Include Memory**. Without a name, the snapshot is named by the date and time.

Activity lists each action as "You, through Shortcuts". In Terminal:

```sh
osmates audit show --session shortcuts
```

## If a shortcut doesn't run

If you see "OSMates' background service isn't on", open OSMates and turn the service on, then run the shortcut again. See [Start the background service](https://osmates.com/docs/install#start-the-background-service).

Other errors use the library's words, and some offer a next step, such as Wait to Start. They leave out what the guest wrote, because Siri can read errors aloud.

## Limits

- Shortcuts offer only this Mac's machines, not templates or a paired Mac's machines.
- Renaming a machine keeps it in your shortcuts. Deleting it breaks them.
