This package allows you to interact with Siri Shortcuts on macOS Monterey and newer. It provides both interactive user commands, as well as public extension APIs.
This opens up a lot of possibilities for Apple ecosystem automation, including but not limited to:
- Automating HomeKit smart devices
- Using existing iOS utility Shortcuts
- Media playback automation
- Executing other scripts
- Interacting with the macOS window manager
While a lot of these things could be accomlished with Automator and AppleScript, they are quite old and awkward to use, while Shortcuts offer a simple Scratch-like UI with lots of available automations, as well as a gallery to re-use existing Shortcuts.
If you installed from MELPA, you’re done. Just run one of the commands below.
M-x package-install RET siri-shortcuts RET
Then put this file in your load-path, and put this in your init file:
(require 'siri-shortcuts)
This is a small demo of running a Siri Shortcut than turns on a Yeelight Light Strip and sets it to pink:
Run one of these commands:
siri-shortcuts-run
: Run a Siri Shortcut from a list of available Shortcuts.siri-shortcuts-run-async
: Same assiri-shortcuts-run
, but asynchronous.siri-shortcuts-gallery-open
: Open the Shortcuts Gallery.siri-shortcuts-gallery-search
: Search the Shortcuts Gallery.siri-shortcuts-open-app
: Open the Shortcuts app.siri-shortcuts-edit
: Edit an existing Shortcut.siri-shortcuts-create
: Create a new Shortcut.
- You can use the full Shortcuts scheme URL API by using the function
siri-shortcuts-browse-url
.For example:
(siri-shortcuts-browse-url "open-shortcut" "MyShortcut")
Or use the high-level functions directly in your code:
(siri-shortcuts-run "SampleShortcut")
Bug reports, feature requests, suggestions — oh my!
GPLv3