How to schedule macOS Shortcuts
macOS Monterey 12.1 Shortcuts does not come with an inbuilt way to schedule Shortcuts automatically. But with a few simple steps we can easily set that up. Hopefully in a later version this feature will be available, but for now, I’ll show the easiest way I’ve found to schedule Shortcut to run at specified times.
The Scenario
Let’s imaging each morning when we open our macs we’d like to see a notification waiting for us with any useful info from a Shortcut or maybe to simply have any shortcut run automatically. Perhaps the notification will have breaking news, latest Bitcoin value or anything else you are interested in.
The Shortcut
For me though, what is really important is to have some cat facts ready in the morning to start my day. In a previous post you can see how to create this kind of Shortcut. For this post though we’ll need to change that Shortcut to display a notification rather than an alert. If you want to skip that post you can see an image below of the final Shortcut.
If for some bizarre reason you are not into cat facts (why?), read this post and this post to see how you can easily point to other APIs to get stuff you are interested in.
The Scheduling
There are a few ways to schedule tasks on your Mac, one such way is to use launchd
, but it is a little tricky to set up and figure out why its not working (spent too long on this and still was not working as expected). So instead for this post we are going to use Automator
which was the simplest way I’ve found to get up and running quickly.
btw, Automators life may be coming to an end in a few years, but I expect by the time Shortcuts can schedule we’ll no longer need Automator. But for now it’s the simplest and least painful way to get started.
Automator
The first step in scheduling a Shortcut is to use the Automator
app that will run a script, where the script will run the Shortcut. Sounds a little messy but it’s quite easy to do and you’ll be done a minute.
- First open the
Automator
app - Select File/New
- Choose type as
Application
- In the search bar enter
Run Shell Script
and drag drop into the work space on the right - Select
shell
asbin/bash
, and enter the commandshortcuts run <shortcut-name>
. My shortcut is called “Awesome Cat Facts” so my command will beshortcuts run "Awesome Cat Facts"
.
To test this launches the shortcut and creates a notification select the Run
button top right.
Ok, almost done, now save that automation task.
One more step to go.
iCal
The last step in this process is to use iCal to create a repetitive Event that runs at 9am every morning which runs the Automator task (which in turn runs the shortcut).
- Open iCal
- Add a new Event
- Set event title, start/end time and set repeat as
Every day
- Next select
alert
and choose thecustom...
option (see below)
- A new menu will appear. From the first drop down list select
Open File
. - On the 2nd drop down list select defaults to
Calendar
, instead selectOther...
. A finder window will open, from here select the Automator task you saved in the above steps. - Finally tell the event to use
At time of event
.
Congratulations you now have a Shortcut that will run at the same time each morning and fires a notification for you.
Don’t forget you can amend the Automator script to run any Shortcut or any number of Shortcuts that you would like to schedule. And yes, for what ever reason you might have, you can use a Shortcut not about cat facts.
To see what else I’ve been learning about Shortcuts you can select this link.
If that post helped and you like the idea of planting trees, all you need to do is follow me. Once I hit the magic number of Medium followers it will allow me to donate to these guys. Many thanks.