Fixing PopClip’s Shortcuts Issues…with Shortcuts
You know how on iOS and iPadOS when you highlight text, you get that little popover menu with Copy, Paste, and Share buttons? Super helpful, right? What if I told you that you could get that same functionality, plus more, on macOS as well?
Great news: You can, with PopClip!
Bad news: If you try to get the most out of PopClip by integrating it with Shortcuts, it crashes.
Good news: I’ve got a workaround to fix it.
First, a Bit of Love for PopClip
I’ve been using PopClip, developed by Pilotmoon Software, for years. It costs a cool $15.99 on the Mac App Store, and I’ll tell you, it’s worth every penny. I’d gladly pay that amount in an annual subscription to keep using it.
Even before we get to the, well, extensive Extension library to power up PopClip, you get a bunch of functionality with the vanilla installation. Not only are there the staples like Cut, Copy, and Paste, but you can also fire off a web search from your highlighted text, open links, look up a definition, and correct spelling mistakes just by highlighting some text.
But don’t skip on clicking through the menu bar app to its puzzle piece tab, which brings up the list of PopClip extensions you have installed. There you can rearrange or remove existing extensions (pencil icon) and visit the extension library to download actions for additional functionality (plus icon).
And there are some wild things you can do with these extensions. Things like applying a ROT13 cipher to your text, having your computer speak out the selected text, creating calendar entries, sorting lists alphabetically, or bookmarking a URL with Pinboard. In fact, I just downloaded another new one that I’ll use all the time for writing blog post metadata: Timestamp, which inserts the current date and time in a variety of formats right from that popup menu.
I’ve installed the following:
- Online Thesaurus (look up synonyms)
- Title Case (convert text to Title Case)
- Copy as Markdown (convert rich text to Markdown)
- Convert Markdown to HTML
- Slugify (convert text to a web-worthy URL slug)
- Parcel (add tracking numbers to my deliveries app)
- Drafts (send text to the Drafts app)
- Things 3 (create a new task in Things)
- Pocket (save a URL to read later in Pocket)
- and now Timestamp
Some of these replicate functionality that I’ve built into shortcuts. But when you want to fire off a shortcut with some selected text as the input, Extension Snippets are where you want to look. The guys at MacStories have written extensively about building Extension Snippets, so I won’t rehash the whole process here. But I will say that it’s amazing how you can install your own extensions simply by highlighting some properly syntaxed text.
For example, this text:
#popclip name: Copy as Affiliate Link icon: symbol:bag requirements: [urls] shortcut name: Copy as Affiliate Link
creates an extension that runs my affiliate linking shortcut, complete with a custom symbol, and only when a URL is selected.
Pilotmoon provides thorough documentation on all the syntax options.
But Here’s the Thing…
It’s no secret that I love Shortcuts. So when there’s a roadblock to using them, I find it frustrating. PopClip promises smoother access to text-based shortcuts, but this bug is a real showstopper. You see, for months, whenever I’ve run a shortcut from a PopClip extension, PopClip gets stuck in an endless spinner. A less vibrant spinning beach ball. And none of its vast functionality can be used until PopClip is entirely quit and reopened. At least the shortcut does run while PopClip stalls.
As I said, I’ve dealt with these crashes for months. I run my URLs Menu shortcut1 multiple times per Mac session. So, each time, I have to click the PopClip menu bar app, select Quit, and then relaunch it from Alfred to get any popups to show again.
It finally occurred to me today that I could create an automatic kicking machine to get PopClip back into gear by using Shortcuts itself. The method really couldn’t be more straightforward. At the end of any shortcuts that I run with PopClip, I’ve added three actions:
- Quit App (PopClip)
- Wait (2 seconds)
- Open App (PopClip)
Here they are in a standalone version:
Get the ‘Restart PopClip’ shortcut →
Technically, I sometimes add a fourth action, the ‘If’ action, which checks to confirm that it’s being run on a Mac, and then does the quit/reopen dance. Otherwise, it skips those actions entirely.
I hope that Pilotmoon will eventually put out an update to fix this bug. Running shortcuts with Extension Snippets is an advertised feature, but the stalling out isn’t listed as a known issue. Perhaps there’s something weird going on with my Mac specifically, but I’ve tried the published troubleshooting steps, including uninstalling PopClip and starting fresh. And, yes, I did reach out to the developer to let them know about the problem.
However, with my duct-tape fix in place, I can leave the spinner behind and get on with using two of my favorite Mac apps in tandem. Like feuding brothers, they sometimes giveth and sometimes taketh away. But right now, they just giveth.
UPDATE (2022-12-02): In some truly fantastic turnaround time, PopClip developer Nick got back to me with great news:
I have been doing some work on this and I have a beta version (linked here) that may solve the problem.
I can confirm that every shortcut worked properly with no crashes in my tests! PopClip only shows the spinner while the shortcut runs, then resolves when it’s complete and continues to work as normal afterward.
I’ll continue to use my workaround until the update ships in the production version of PopClip (which I’m told should be soon). But you’re welcome to read the changelog and try the beta version ahead of time yourself.
UPDATE (2022-12-06): The latest update to PopClip, which fixes this issue, was released to the Mac App Store today. I’ll keep the Quit/Wait/Open technique in mind for future apps troublesome apps.
Here’s the iCloud link for ‘URLs Menu’, but it primarily serves as a launcher for other web-related shortcuts.↩︎