This Week's Sponsor:

Kolide

Ensure that if a device isn’t secure it can’t access your apps.  It’s Device Trust for Okta.


MacStories Starter Pack: Introducing Obsidian Shortcut Launcher, A Free Plugin to Trigger Shortcuts from Obsidian

Obsidian Shortcut Launcher is a free plugin that works on iOS, iPadOS, and macOS.

Obsidian Shortcut Launcher is a free plugin that works on iOS, iPadOS, and macOS.

Editor’s Note: Obsidian Shortcut Launcher is part of the MacStories Starter Pack, a collection of ready-to-use shortcuts, apps, workflows, and more that we’ve created to help you get the most out of your Mac, iPhone, and iPad.

It shouldn’t come as a surprise to anyone that, over the past year, Obsidian has become as essential to my workflow as Shortcuts. As I have been thoroughly documenting in the My Obsidian Setup series for Club MacStories members, Obsidian – which is the MacStories Selects 2021 App of the Year – is more than a text editor: it’s something more similar to an OS for writers that encompasses note-taking, Markdown writing, journaling, research, and more. At this point, just like I can’t imagine using Apple devices without Shortcuts, I can’t imagine taking notes or writing articles without Obsidian.

Which means that it shouldn’t surprise anyone either that I wanted to combine my two favorite apps and figure out a way to integrate Obsidian with Shortcuts.

Today, I’m thrilled to introduce Obsidian Shortcut Launcher, a free Obsidian plugin – available in the Community Plugins section of the app – that lets you trigger shortcuts as commands from Obsidian. With Obsidian Shortcut Launcher (or ‘OSL’), you’ll be able to trigger any shortcut you want from Obsidian, passing along values such as the text of the document you’re working on, its name, text selection, and more. Obsidian Shortcut Launcher is free to use and works on iOS, iPadOS, and macOS.

Obsidian Shortcut Launcher is the result of weeks of planning and work from me and Finn Voorhees, and it has created an entirely new dimension in how I use Obsidian and Shortcuts on a daily basis. Because OSL is available in Obsidian’s Community Plugins list, you can find its source code here. Read on below to find out how OSL works behind the scenes, how I’ve been using it for my setup, and how you can start using it yourself with Obsidian and your favorite shortcuts.

Quick Video Tour

You can read Obsidian Shortcut Launcher’s full documentation below, but if you want to get started with the plugin quickly, we also made a video that goes through the process of creating your first launcher and using Obsidian and Shortcuts together.

Installing Obsidian Shortcut Launcher

You can find the plugin in Obsidian’s Community Plugins section. Just search for ‘Obsidian Shortcut Launcher’, install it, then enable the plugin to start using it in Obsidian.

Installing OSL as a community plugin in Obsidian.

Installing OSL as a community plugin in Obsidian.

Creating Launchers for Shortcuts

Creating launchers for Shortcuts in Obsidian.

Creating launchers for Shortcuts in Obsidian.

OSL works by creating “launchers” for shortcuts you want to run in the Shortcuts app. These launchers show up as individual commands in Obsidian.

You can create a new launcher for Shortcuts in OSL’s settings by tapping the ‘New’ button. When creating a new launcher, there are three main fields you have to configure:

  • Command Name: The name of the launcher. This will appear as a command in Obsidian. This name can be anything you want and does not need to match the name of the shortcut.
  • Shortcut Name: The exact name of the shortcut you want to launch in Shortcuts app.
  • Input Type: The input you want to pass from Obsidian to the Shortcuts app. See next section for more details.

Passing Input Values from Obsidian

Obsidian Shortcut Launcher lets you run shortcuts with input text sent by Obsidian. There are seven different input types you can pass from Obsidian to Shortcuts:

  • Selected Text: The current text selection from Obsidian.
  • Current Paragraph: The text of the paragraph the cursor is currently in. (Not available in Reading mode.)
  • Entire Document: The entire text of the current document.
  • Link to Document: The Obsidian URL to the current document.
  • Document Name: The name of the current document, without file extension.
  • Document Path: The relative path to the current document in your Obsidian vault.
  • Selected Link/Embed Contents: The contents of the file referenced in an [[internal link]] under the cursor. If the internal link points to a note, the full text of the note will be passed to Shortcuts as input; if the internal link points to an attachment (e.g. an image), the file will be encoded with base64 first and passed to Shortcuts as base64-encoded text. (Not available in Reading mode.)

(Please note: you can also run shortcuts without any input from Obsidian. In that case, just use any value you want, but ignore it in Shortcuts.)

Here is an example of an Obsidian command that has passed the name of the current document to a shortcut in the Shortcuts app:

As example of triggering a shortcut that fetches the current document's name.

As example of triggering a shortcut that fetches the current document’s name.

And here is how you can receive attachments from Obsidian and decode them using base64 in Shortcuts:

You can even pass attachments from Obsidian to Shortcuts thanks to OSL.

You can even pass attachments from Obsidian to Shortcuts thanks to OSL.

Passing Multiple Values with Custom Separators

OSL also features a ‘Multiple’ option that lets you pass multiple values at once to a shortcut. When you select this option, you can choose multiple input types, which will be passed to Shortcuts all at once with a separator.

By default, the separator character is , (a comma), but you can change it to be whatever you want. To access multiple input values in Shortcuts, use the ‘Split Text’ action and enter a value for the Custom Separator.

Running Shortcuts with Input from Obsidian

OSL commands show up in Obsidian's native command palette and can be assigned hotkeys.

OSL commands show up in Obsidian’s native command palette and can be assigned hotkeys.

Text passed by OSL to a shortcut is available in the default ‘Shortcut Input’ variable of the Shortcuts app. In the case of files passed as base64-encoded text, you will have to decode the input first using the dedicated ‘Decode Base64’ action in Shortcuts.

Due to system limitations, on iOS and iPadOS 15 OSL needs to leave Obsidian and open the Shortcuts app to run a shortcut. That’s because shortcuts can only be invoked by other apps with a URL scheme on iOS and iPadOS 15.

On macOS Monterey, OSL can run shortcuts in the background – without opening the Shortcuts app at all – thanks to shell commands. When using OSL on a Mac, you can trigger shortcuts as commands without leaving Obsidian – a powerful experience that perfectly complements the app.

How I’ve Been Using Obsidian Shortcut Launcher

Obsidian Shortcut Launcher is changing how I use Obsidian because it allows me to turn my shortcuts into quasi-native features of Obsidian. Particularly on macOS, where OSL can trigger shortcuts in the background – without launching the Shortcuts app at all – the plugin enables me to take any existing shortcut and use it as part of my Obsidian workflow.

For instance, I can now publish articles to MacStories’ WordPress installation directly from Obsidian thanks to an OSL command. When I run the ‘Publish Article to WP’ command in Obsidian, OSL takes the text of the current document and passes it to my Publish to WordPress shortcut, which I’ve been using for years now. In other text editors, I’d have to manually copy the article text, then open the Shortcuts app and run the shortcut myself; with Obsidian and OSL, I can press a single hotkey and the command I’ve configured takes care of communicating with Shortcuts for me.

Posting to WordPress from Obsidian thanks to OSL.

Posting to WordPress from Obsidian thanks to OSL.

On a similar note, I’ve connected Obsidian and Shortcuts with OSL commands to upload image attachments to our CDN and, perhaps more interestingly for our readers, a command that runs a shortcut that backs up the current note to three different locations: local storage, iCloud Drive, and Dropbox. Now when I’m working on an important story that I want to back up across multiple services, I just need to press a single hotkey and Obsidian will trigger the related shortcut in the Shortcuts app.

Even as the person who came up with the idea for OSL, I’m still thinking of all the possibilities opened up by the ability to send different input types from Obsidian to Shortcuts. For this reason, I also wanted to know from someone who’s been using OSL for over a month now on how the plugin fits in their workflow. Here’s what our very own John Voorhees said:

I’ve been playing around with versions of Obsidian Shortcut Launcher since Christmas, and it’s become one of the Obsidian plugins I use the most. What’s struck me most about it is how handy it is to have simple utility shortcuts available to handle small tasks as I write. I have a launcher that builds the titles of documents by having Shortcuts look up the current episode number of AppStories or issue number of MacStories Weekly from their RSS feeds, so I don’t have to. I’ve also been using a shortcut to look up Twitter bios. I highlight a name of someone in a note, invoke OSL with Obsidian’s command palette, and it fetches their bio from Twitter’s website.

On the more complicated end of things, I have a shortcut that I’ll be sharing Friday with Club MacStories members that draws on the Periodic Notes and Buttons plugins along with OSL to create a weekly note where I plan my week. The note includes links to the next seven days of tasks in GoodTask’s Kanban view and links each day of the week to that day in Fantastical, so I can easily access my schedule for that day as I plan my work. It’s a terrific example of the sort of advanced automation that is possible when you combine Shortcuts with Obsidian.

Get Started with Obsidian Shortcut Launcher

You can get started with Obsidian Shortcut Launcher by searching for it in Obsidian’s Community Plugins section and installing it in the app. The plugin is free to use and download, and you can check its source code in the official GitHub repo here.

My thanks to Finn Voorhees for helping me create this plugin and the Obsidian developers for working with us on accepting it in the Community Plugins section. I hope you’ll like the flexibility afforded by this plugin and that you’ll find it as useful as we did at MacStories. I can’t wait to see how you’re going to combine Obsidian and Shortcuts with Obsidian Shortcut Launcher.

You can follow the MacStories Starter Pack on our hub, or subscribe to the dedicated Starter Pack RSS feed.

Brighten up the year with Daylite: Power up your business with the best CRM app made for Mac.

Unlock More with Club MacStories

Founded in 2015, Club MacStories has delivered exclusive content every week for over six years.

In that time, members have enjoyed nearly 400 weekly and monthly newsletters packed with more of your favorite MacStories writing as well as Club-only podcasts, eBooks, discounts on apps, icons, and services. Join today, and you’ll get everything new that we publish every week, plus access to our entire archive of back issues and downloadable perks.

The Club expanded in 2021 with Club MacStories+ and Club Premier. Club MacStories+ members enjoy even more exclusive stories, a vibrant Discord community, a rotating roster of app discounts, and more. And, with Club Premier, you get everything we offer at every Club level plus an extended, ad-free version of our podcast AppStories that is delivered early each week in high-bitrate audio.

Choose the Club plan that’s right for you:

  • Club MacStories: Weekly and monthly newsletters via email and the web that are brimming with app collections, tips, automation workflows, longform writing, a Club-only podcast, periodic giveaways, and more;
  • Club MacStories+: Everything that Club MacStories offers, plus exclusive content like Federico’s Automation Academy and John’s Macintosh Desktop Experience, a powerful web app for searching and exploring over 6 years of content and creating custom RSS feeds of Club content, an active Discord community, and a rotating collection of discounts, and more;
  • Club Premier: Everything in from our other plans and AppStories+, an extended version of our flagship podcast that’s delivered early, ad-free, and in high-bitrate audio.