June 22, 2021 at 6:33 AM by Dr. Drang
Two years ago, shortly before WWDC 2019, Guilherme Rambo told us that Shortcuts was coming to the Mac as a Marzipan app.1 I wrote a post about the levels of automation on the Mac and how a Marzipan Shortcuts would add a new level. I was concerned with whether Shortcuts would carry on the tradition of allowing communication between the Mac’s different levels. Since Shortcuts didn’t come with Catalina—or with Big Sur, for that matter—I haven’t had to revisit that post. But with WWDC 2021 and the official announcement of Shortcuts coming to Monterey, it time for an update.
Here’s how I characterized the Mac and its automation before Shortcuts:
The modern Mac OS—whether we call it OS X or macOS—sits on top of Darwin, a BSD-flavored Unix. The Darwin level can be automated through all the typical Unix scripting languages, and the Mac level can be automated through AppleScript or Automator. Significantly, though, Apple included ways for the levels to talk to one another:
do shell scriptconstruct was added to AppleScript to allow automation at the Darwin level to be run within AppleScripts.
- Automator included the action to do the same thing there.2
automatorcommands were added to
/usr/binto allow shell scripts to run AppleScripts and Automator workflows.
Had Shortcuts come to the Mac as a Catalyst app, I figured that would mean it would be restricted to automating other Catalyst apps, and there’d be a need for another set of automation tools to communicate between levels—something that Rambo’s article said nothing about.
But two things happened to make this graphic wrong:
- Shortcuts isn’t a Catalyst app and isn’t restricted to automating other Catalyst apps. So it sits nicely in the Macintosh level, just like AppleScript and Automator.
- Apple filled in communication gaps.
Over the past couple of weeks, I’ve read the posts and listened to the podcasts of those
foolhardy brave souls who’ve installed the first developer beta of Monterey on their Macs and have tried out Shortcuts.3 I’ve also watched the “Meet Shortcuts for macOS” session video. Here’s how I think the state of Mac automation on Monterey can be characterized:4
I’ve grayed out Automator because it’s clearly not long for the world. It hasn’t been officially deprecated, but I wouldn’t be surprised to get that announcement next year.
As you can see, Shortcuts has aaction, just like Automator’s. You can see it in the sidebar of this screenshot from the “Meet Shortcuts” session:
Going in the opposite direction, there’s now a
shortcuts command that can run shortcuts from Terminal or a shell script:
In writing the post two years ago, I forgot to include Automator’s ability to run AppleScripts with theaction. Shortcuts has an action with the same name, and there’s also a way to run Shortcuts from within AppleScript:
It looks like “Shortcuts Events” is like “System Events” and “Image Events”—an application that exists purely for its AppleScript dictionary. A word of warning: Jason Snell tells me that “Shortcuts Events” isn’t available in the current developer beta. But when it is, we’ll have ways to communicate in both directions between Shortcuts and AppleScript within the Macintosh level.
Update Jun 29, 2021 3:25 PM
The second developer beta of Monterey added Shortcuts Events and the
run the shortcut command.
All in all, this looks like everything I wanted in Mac Shortcuts. As I said in the post two years ago, the ability to run every kind of automation from every other kind of automation is key to making a fluid system, where you can use each tool for what it does best. Also, it means that third-party automation tools like Keyboard Maestro, which has a good AppleScript dictionary for running its macros, will fit in well with the new environment even before they incorporate Intents that are directly accessible from Shortcuts.
There is one oddity left unresolved. The emphasis Apple put on being able to run shell scripts from Shortcuts and vice versa seems to be at odds with its declaration with the release of Catalina that built-in scripting languages are being deprecated:
Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for compatibility with legacy software. Future versions of macOS won’t include scripting language runtimes by default, and might require you to install additional packages.
I’m certainly not worried about this on my behalf—I know I’ll be able to install whatever languages I need. But people who are uneasy about using the command line but would like to use Shortcuts written by others may be left in the lurch. Maybe Apple will bundle scripting languages with Mac Shortcuts so the language runtimes will be there when you need them. Or maybe that deprecation will be deprecated.
You remember Marzipan, don’t you? That’s what we called Catalyst before it was officially announced. ↩