Home/Q&A/Can Shortcuts run automatically on a schedule on a remote Mac mini?

Can Shortcuts run automatically on a schedule on a remote Mac mini?

Updated · airankrush

Direct answer

Yes. A shortcut can be started from the command line with shortcuts run and scheduled with launchd. Newer macOS versions also have automations built into the Shortcuts app; whether you have them depends on the system version on the machine.

Basis

  • macOS ships with the shortcuts command-line tool: shortcuts list shows the shortcuts on the machine, and shortcuts run followed by a name runs one of them. So anything that can run a command on a schedule can run a shortcut on a schedule.
  • For the scheduling layer, use a LaunchAgent in your own user folder. Put the run time and the command in it, and send the output to a log file so you can see afterwards whether each run succeeded.
  • Newer macOS versions added “Automation” to the Shortcuts app, which can trigger on a time, a folder change and other conditions. Which system version your machine has is stated in the delivery notes; if you want to upgrade the system, contact support first, because an upgrade is an operation that can cut your connection.
  • Shortcuts sync between devices through iCloud. They only sync to the remote Mac after you sign in with a dedicated Apple Account there; if you would rather not sign in, export the shortcut as a file and import it.

Information as of .

Boundaries: when the answer is different

Shortcuts that use “Ask Each Time”, a file picker or a confirmation dialog will stop at that step and wait forever when nobody is at the machine, so remove those interactions in the editor before you rely on the shortcut. Actions that control other apps trigger a system permission prompt on first run; you have to be connected to the desktop and click it yourself once, and after that it stops asking. Scheduled triggers only work once your user session is logged in, and whether the session comes back by itself after a restart depends on the login configuration the machine was delivered with. If a system update changes how an action behaves, that is not something we can guarantee against; for usage details, follow Apple's Shortcuts User Guide.

How to do it

  1. Connect to the desktop, run the shortcut by hand once in the Shortcuts app, and deal with every permission prompt that appears.
  2. Open Terminal, run shortcuts list to confirm the name, then try the same shortcut with shortcuts run.
  3. Create a scheduled entry under ~/Library/LaunchAgents that calls this command, and give it a log path.
  4. Disconnect, wait until one trigger time has passed, then reconnect and read the log.
  5. Restart the machine once from the customer console and confirm the scheduled entry still works after the session logs back in.

Use case

This question belongs to the use case: iMessage, AppleScript and Shortcuts on a rented Mac mini: it runs, but Apple decides about your account

Other questions in the same use case:

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All Q&A