MacOS 26 and Shortcuts, can it call a KM macro?

I saw in a Youtube video today that macOS 26 has given the Shortcuts app various "automations" which are essentially triggers, many of which work the same way as KM triggers (e.g., when a time of day occurs, when an external drive connects, when WIFI connects, when an app opens or closes, etc.) but some of the triggers allowed in macOS 26 are new things that KM cannot currently trigger on (e.g., when a battery level is reached, when an email from X arrives, when a text from Z arrives, etc.) Some of these new things have great potential, and I would like to use those triggers, preferably to pass on to the KM Engine so that my KM macros can deal with the events.

I realize that we can already trigger KM macros from macOS by using either the KM command line tool or the AppleScript osascript command. I have used these but I found them to be difficult (and the current Shortcuts app doesn't support automations anyway.) So is it possible for Keyboard Maestro to provide an "action" for the macOS 26 Shortcuts app that will call the KM Engine to trigger a KM macro and pass some data to it? I believe Apple does allow third party developers to produce "actions for the Shortcuts app." The last couple of minutes of this video from WWDC25 explain to a developer how to do this.

Technically the developer of KM is not the only party which could write an action for macOS 26 Shortcuts. There are probably a few wizards on this site who can write Swift code in Xcode and can follow the advice in that video to create a small action for Shortcuts that will pass data to the KM Engine. In order to help visualize it, here's a captured image of the Run Shell Script action in Shortcuts. A new action to execute a KM macro would look something like this, but would specify the name of the macro, and hopefully have a field to pass data as a parameter to the macro. I don't think the action would require and of the four options we see at the bottom of this image.

So this post that I'm writing is essentially a feature request, but as this feature is technically outside of the KM software, it could be anyone who provides this feature. And it's entirely possible that KM is already going to be updated to support this, but I would't know that.

The list of triggers that will be supported in Shortcuts is not very long, from what I can see, so it's not much of a threat to the KM product. But Shortcuts is getting some triggers now, so it does introduce a little competition for KM.

Here is the video that was just release a couple of hours ago that caused me to write this request. The relevant portion starts around 13:00.

1 Like

Keyboard Maestro already has an Execute Macro shortcut.

image

1 Like

Of course that's absolutely wonderful. I'm very happy.

If I may try to explain why I was not aware of this:

  • None of those actions show up in the list of "All actions" in Shortcuts. I can't find them.
  • There is no category called "Keyboard Maestro" in Shortcuts like there is for other apps
  • None of the KM actions show up when I click on "Scripting"
  • I had no idea that I had to type the words "Keyboard Maestro" into the search box to find them
  • I never saw this feature mentioned in the wiki (is it? I just tried looking for it)
  • I never saw this feature mentioned in these forums.

I know I'm a person of mediocre skill, but where should I have learned about this amazing feature?

There is mention of KM support for Shortcuts in the User Manual (and I presume it was in the release notes for KM v10.1 when it was introduced).

https://wiki.keyboardmaestro.com/Shortcut_Actions?s[]=shortcuts

Alright, I have egg on my face again. It is documented. I think I was thrown off track because the page starts by mentioning KM's own action for executing macOS shortcuts, and I wasn't expecting the reverse to also be documented on that same page. My mistake.

Even so, the page as it stands does not say anywhere that in order to be able to see any of the actions, you actually have to type in the words "keyboard maestro" into the Shortcut app's search box. I'm not sure I would have been able to figure that out. Considering that the Shortcuts app has so many groups and apps showing up, I absolutely would have expected to see a section for Keyboard Maestro in there, but since it isn't in there, and I've read through every section, I assumed there was nothing to find.

For illustration, none of the KM actions show up if you click on any of the sections near the top of the image below, nor is there a section called "Keyboard Maestro in the bottom half of the image. So I don't feel too bad for not finding it. I just feel slightly bad.

image

The main thing I've learned is that KM is filled with amazing surprises, even though I've used it for more years than I can remember.

Yes, I don't know why Keyboard Maestro is not listed in there.

Clearly something I haven't done right.

1 Like

Thanks very much. I'll mark your original response as a solution. Thanks for considering an update.

This will be good to know when I get to using a Mac that has Shortcuts. Seriously. Thank you.

1 Like

Thank you for sharing this vid. I also watched the one about Apple’s greed :scream:

Thanks for pointing out this KM support in shortcuts @Airy . I knew about the support to invoke shortcuts from KM but did not know it went both ways. I've always fired off a KM macro by using the "Get contents of URL" shortcut action and then specifying a KM remote trigger URL. Using the native action is so much cleaner.

I think the Wiki could be clearer about this integration.

Wow. I see support from 3 different wizards. What a great way to start the day.

Or maybe a bug in macOS? Oh wait, there aren't any of those. /s

-rob.

5 Likes