Six Colors
Six Colors

by Jason Snell & Dan Moren

This Week's Sponsor

Kolide ensures only secure devices can access your cloud apps. It's Device Trust for Okta. Watch the demo today!

By Jason Snell

Create visual feedback for running Shortcuts

A picture of the menu bar item in action

Earlier today, I was complaining to Shortcuts expert Matthew Cassinelli about how there’s no really good way to view progress of a running Shortcut on macOS. Yes, the Shortcuts menu item in the menu bar sort of tries to display progress, but… it doesn’t provide any information I find particularly valuable.

I’m frustrated because I do have some Shortcuts that take time to run, yet unless I have them beep or display a notification when they reach a certain point in the process, I have no idea what they’re doing or if they’re even working.

Based on a recommendation from Matt, I managed to come up with my own little notification system. It uses SwiftBar, my favorite utility for ambient data in my Mac’s menu bar, but you could also adapt it to work with BitBar or One Thing or any other utility you’re comfortable with.

Step one is a python script, echo, that serves as my SwiftBar plugin. It reads the contents of a text file and converts them into a format SwiftBar wants: The first line is displayed in the menu bar, and if there are additional lines, they’re displayed when you click on the first line. The script also inserts a timestamp so you know the last time the status was actually updated. (Like I said, some of my Shortcuts take a very long time to run.)

Step two is writing to that text file from Shortcuts and telling SwiftBar to update the menu bar immediately. That’s pretty easy. First, I use SwiftBar’s “enable plug-in” action to turn on my plug-in. Then I create a text field containing my status, save that to my file, and use SwiftBar’s Reload action to immediately force the new data to appear in my menu bar.

A three-step shortcut to write text, save it to disk, and reload the plugin

The result is just what I want—an indicator of where we are in the process, and when I click, a little more information about what’s going on.

Then at the end of the job, I just need to remember to tell SwiftBar to deactivate the plug-in until I need it next. And that’s it! It might not be the ready-made solution I wanted, but it’s better than not having any idea what’s happening.

If you appreciate articles like this one, support us by becoming a Six Colors subscriber. Subscribers get access to an exclusive podcast, members-only stories, and a special community.

Search Six Colors