THIS WEEK'S SPONSOR:

Daylite

Take Your Business Out Of The Dark With Daylite


Accessing Shortcuts for Mac with Alfred Workflows and Universal Actions

Alfred users can now access their library of shortcuts on the Mac, thanks to an official Alfred workflow by Vítor Galvão. The workflow allows users to access individual shortcuts and folders of shortcuts, as well as pass text and files to shortcuts for processing. It’s a nice approach that uses Alfred’s existing workflow system to invoke Ruby and Bash scripts under the hood.

Searching for individual shortcuts (left) and by folder (right).

Searching for individual shortcuts (left) and by folder (right).

Let’s start with the easiest approach first. Invoke Alfred with the hotkey you’ve assigned to the app, then type ‘sc’ for Shortcuts. Any shortcuts you’ve recently accessed through Alfred will appear at the top of the list for quick access. If you need a different shortcut, though, start typing its name to filter the results until you see the one you want. Press Return and the shortcut will run.

Browsing shortcuts by folder.

Browsing shortcuts by folder.

If you don’t recall the name of the shortcut you want or want to browse a folder of shortcuts before running one, type ‘scd’ instead, which lists all of your shortcuts folders. Highlight one and hit Return to see all of the shortcuts in that folder.

Providing text to Alfred that displays an alert.

Providing text to Alfred that displays an alert.


Using Universal Actions to pass the text to the Alert shortcut.

Using Universal Actions to pass the text to the Alert shortcut.

Alfred’s Shortcuts workflow also incorporates its Universal Actions feature, which was introduced last year. The simplest way to pass some text to a shortcut is to invoke Alfred, type, or paste some text into its UI. Then, invoke Alfred’s Universal Actions to display a list of commands that can be performed on the text you provided.

The list of Universal Actions includes ‘Run shortcut,’ ‘Shortcuts,’ and ‘Shortcuts Folders.’ ‘Run shortcut’ lets you pick from your list of shortcuts and then uses the text you provided to Alfred as its input. The ‘Shortcuts’ action locates any shortcuts that match the text you provided, and ‘Shortcuts Folders’ does the same searching instead for folder names that match your text. URLs and files work similarly when the ‘Run shortcut’ action is selected, passing the URL or file as input.

Picking an image to pass to a shortcut.

Picking an image to pass to a shortcut.


Displaying an image passed to a simple 'Open File' shortcut.

Displaying an image passed to a simple ‘Open File’ shortcut.

Vítor Galvão’s Alfred workflow for Shortcuts, which you can download from GitHub, is an excellent example of Alfred’s extensibility, which makes a series of Ruby and Bash scripts approachable for more users through Alfred’s simple UI. The workflow is also another of the many examples of just how well Shortcuts for Mac integrates with third-party utilities thanks to its scripting support and other integrations with macOS.

Unlock MacStories Extras

Club MacStories offers exclusive access to extra MacStories content, delivered every week; it’s also a way to support us directly.

Club MacStories will help you discover the best apps for your devices and get the most out of your iPhone, iPad, and Mac. It’ll also give you access to advanced iOS shortcuts, tips and tricks, and lots more.

Starting at $5/month, with an annual option available.

Join the Club.

A Club MacStories membership includes:

  • MacStories Weekly newsletter, delivered every week on Friday with app collections, tips, iOS workflows, and more;
  • MacStories Unplugged podcast, published monthly with discussions on what we’re working on and more;
  • Monthly Log newsletter, delivered once every month with behind-the-scenes stories, app notes, personal journals, and more;
  • Access to occasional giveaways, discounts, and free downloads.