Skip to content
Treadle

Write your own command

Updated October 1, 2026

For something Shortcuts can't do, a Custom action runs a command you write on the Mac. The iPad or iPhone only ever sends a generated id, never the command text, so nothing you type into a button can be triggered or read from the device itself.

Set a custom command

  1. On the Mac, open the menu-bar popover and choose Edit decks….
  2. Add a control, or select one you already have.
  3. In the action picker, choose the Custom source.
  4. Enter the command to run on the Mac.
  5. Set a label and an icon, then save.

How it stays safe

When you save a custom command, Treadle gives it a generated id. The iPad or iPhone only ever receives that id, never the command text. Pressing the control tells the Mac to run the action with that id. This is the same rule as every other action: the iPad or iPhone sends a name, not a command. See the concepts page.

When to use a custom command

Reach for a custom command only when neither a built-in action nor a Shortcut will do. A Shortcut is often the simpler choice and is free.

If it does nothing

Check that the command runs on its own in a terminal on the Mac, that any helper tool it needs is installed, and that Treadle has the permissions the command relies on. See A button does nothing when I press it.

Questions & answers

Is a custom command safe?
The command lives on the Mac. The device sends only an id that maps to it, so a device can never send an arbitrary command to run.
What can a custom command do?
Anything you could run yourself on the Mac. It's the escape hatch for the few things the other action sources don't cover.

Related