While Shortcuts used to be only for those Apple users that used their mobile devices heavily, macOS Monterey brought Shortcuts support to the desktop Apple experience. While Shortcuts on macOS started out buggy, it’s settled down now into a viable option for your macOS automation tool.
Today we’re going to look at Obsidian Shortcut Launcher Plugin from MacStories. This plugin allows you to trigger Shortcuts from directly inside Obsidian, and pass data at the same time. It’s helped remove a few steps from my writing process, and any time I can take manual work out of my process I’m a happy camper.
Let’s look at some of the ways you can use this plugin to automate your workflow across devices.
Sending Document to Ulysses
The first use I have is to send my blog posts to Ulysses. Yes Obsidian has a Publish to WordPress plugin, but it’s pretty basic and doesn’t play well with modern WordPress. Instead I send my text to Ulysses, which does play nice with WordPress.
To set up a Shortcut from Obsidian you first need to create the Shortcut so you know it’s name. It doesn’t have to do anything if you’re just starting it, but you need to know what you’re going to call it.
The first field is for what you want to call the command that triggers a Shortcut in Obsidian. Second, type in the full name of the Shortcut as it appears in the Shortcuts application.
Finally you need to choose which data you’re going to send to the Shortcut out of Obsidian. The options are:
- Selected Text: The text you currently have selected in Obsidian
- Selected Link/Embed Contents: Follows links to other documents in Obsidian and passes the content of that linked note
- Current Paragraph: The contents of the paragraph currently under your cursor
- Entire Document: The whole document
- Link to Document: The Obsidian URL for the document
- Document Path: The filepath of the document in Obsidian
- Multiple: Let’s you pass multiple parameters to your Shortcut
For my Ulysses Shortcut I pass the
Selected Text to the Shortcut, from there Shortcuts takes over and passes the text to Ulysses.
Sending a Note To Your Task Manager
Another interesting application is when you want to send a note to your task manager. To do this you’ll want to selected
Multiple as the Input Type in the Shortcuts Launcher Obsidian plugin. Shortcuts that deal with multiple pieces of data are necessarily more complex because you need to parse out the string of text that gets sent to Shortcuts from Obsidian.
As you can see in the screenshot above I’ve selected Multiple as the Input Type and then used 2 inputs. First is the document name and second is the link to the document. Finally I’ve set the separator to be
, and I’ll use this in my Shortcut to loop through the values passed and set them as variables.
First our Shortcut splits the text with our custom setting of
, which gives me two items in this case because I’m passing 2 items out of Obsidian. Next I use a repeat block to loop through all the items I passed to Shortcuts.
Inside this repeat block I have a simple conditional statement. It looks for
obsidian: and if it finds it I set my
URL variable to that value. If it doesn’t find
obsidian: then it sets my
Next I use these two variable to set the Title of my new task and pass the URL as a piece of data in the notes inside GoodTask. Once run I can open up GoodTask and find a link to my note inside my Inbox to be filed.
macOS and iOS Differences
You’ll notice that on macOS you don’t have to leave Obsidian to trigger these Shortcuts. That’s because the Obsidian Shortcut Launched detects which platform it is running on and if it’s on macOS it uses the command line to run the Shortcut. If you’re on a mobile device it does need to open up Shortcuts to be able to run.
While I’d love to see that limitation remove and just have my Shortcuts run in the background without leaving Obsidian, it’s out of the hands of the plugin developer and all up to Apple.
One thing to watch out for is that if you’re passing an attachment from Obsidian to Shortcuts it will be
Base64 encoded before it’s passed. That means you need to decode it on the Shortcuts end to deal with the attachment.
There is more information about other things you can do with the Obsidian Shortcut Launched plugin over on MacStories.
For me, it’s streamlined a few parts of my workflow and found a place in the required plugins for my Obsidian usage.