It’s the final week of Automation April, and before we get into the details of the final batch of 10 shortcuts I’ve prepared for this week, I just want to express my gratitude toward all readers – old and new – who checked out MacStories this month, entered the contest, or signed up for Club MacStories. The response to Automation April has exceeded our most optimistic expectations: we received over 200 shortcut submissions for the contest, which is why we’re taking a few extra days to sift through all of them before; look for an official announcement of all the winners next week.
For this final group of 10 shortcuts, I’ve assembled another pretty diverse list of utilities for iPhone, iPad, and Mac that integrate with different parts of Apple’s operating systems. There’s a shortcut that automatically deletes old files from Finder or the Files app; another that finds the unique identifier of a specific task in the Reminders app; there’s a shortcut that gives you a weather report for the location of an upcoming event in your calendar. In case you missed the previous collections of shortcuts, you can find them here and here.
So, with Automation April coming to a close, let’s dive in one last time and check out the details of the shortcuts I’m sharing this week.
Convert Discord URL to Club URL
Last week, we rolled out a new feature for the Club MacStories Discord server I’m very excited about: special club.macstories.net links that let you choose whether you want to open a link to a message in the Club server via the Discord website or one of the Discord apps for Apple devices. Because the Discord apps use different URL schemes across platforms, we had to create a system that automatically redirected you to the proper native app depending on your web browser, as we explained in our announcement here. We think this system provides a better experience for sharing and bookmarking links to useful posts on our Discord server and, best of all, you can set per-device preferences to, say, always open links in a web browser at work but redirect links to the native Discord app on iPhone and iPad.
Because our Alex is a genius, we were able to create links that keep the same channel and message IDs of the original Discord URLs. So, as you can imagine, that meant I could come up with a shortcut to convert any Discord link from our server into a special Club MacStories link. As you can see from the screenshot below, the shortcut is fairly straightforward: it uses a regular expression with two capturing groups (the parentheses) to isolate the channel and message IDs, respectively, which are then re-assembled in a Club MacStories URL at the end. The multiple clipboard actions at the end are, as I explained before, necessary to work around a Shortcuts bug that prevents copying links to the clipboard unless you do it multiple times in a row.
With this shortcut, I can copy a Discord message link such as this one and convert it into this kind of Club link in a second. If you’re a member of our Discord and want to share your own links with other Club members (or just bookmark them for yourself), you can use this shortcut too.
Convert Discord URL to Club URL
Convert a Discord link from the Club MacStories server into a universal club.macstories.net link that supports automatic redirection to the Discord website or native apps.
Find Reminder UUID
A little-known fact of the Reminders app is that there’s a hidden URL scheme to reopen individual reminders directly in the app. Why is this kept secret and not documented anywhere? I don’t know. And why is it useful? Well, given the ability to create checklists with subtasks in Reminders, you may find it convenient to reopen a parent reminder containing dozens of nested items directly, without having to manually search for it.
The URL scheme is the following:
x-apple-reminderkit://REMCDReminder/Reminder UUID
Now, the tricky aspect of this is that there’s no way in Shortcuts alone to grab the UUID of an existing reminder with an action. You can find the unique identifier of a reminder if you inspect the item with the View Content Graph Engine action, but that’s a manual interaction that requires you to navigate into the structure of a Reminder object and find the UUID yourself.
Fortunately, other developers share my pain of being unable to retrieve the UUIDs of specific reminders via Shortcuts. One of them is – unsurprisingly – Toolbox Pro’s Alex Hay, who added a ‘Get Reminder UUID’ action to the app that does exactly that. This action requires a valid reminder title and list as input; if those items are passed correctly to the action, it’ll look for a reminder matching that title in the list you specified and return its UUID, which you can then use however you want.
With my Find Reminder UUID shortcut, you can get the native Reminders URL scheme for any existing, non-completed reminder and use it as a direct launcher for that specific task. The shortcut will first ask you to enter a title of the reminder you’re looking for; then, a ‘Find Reminders’ action will try to find a reminder matching that title across all your lists. This action only returns one result, but if you want to modify it with more filters for a different search scope, you can. As you can see from the image above, the Toolbox Pro action that finds a UUID uses properties from the magic variable provided by the Find Reminders action. Once the shortcut has the UUID, all it needs to do is prepare a valid x-apple-reminderkit://
URL and copy it to the clipboard.
I don’t know why Apple has never publicly acknowledged this URL scheme (even though it exists in Shortcuts’ Content Graph, as seen above), but it doesn’t matter now. With this shortcut, you can get the native URL scheme of any reminder you want and use it as a launcher in Shortcuts, Launcher, or other apps.
Find Reminder UUID
Find the UUID of a specific reminder in the Reminders app. The shortcut requires Toolbox Pro. At the end, it copies the URL scheme of the selected reminder to the clipboard.
Image Grid
This is a simple utility shortcut that lets you combine multiple images from the Photos app in a grid and export it as a single image.
First, the shortcut asks how many images you want to combine with an ‘Ask for Input’ step. Then, it starts a ‘Repeat’ loop set to the number of images you selected that lets you pick one image at a time. You may be wondering: why this approach when you could have just set ‘Select Photos’ to ‘Select Multiple’, bypassing the need to repeat the ‘Select Images’ action multiple times? The answer is easy: sometimes I want to merge images in a specific order in the grid; if I enabled the multiple selection behavior, I’d be forced to follow whatever order the images appear in Photos. With my method, images are combined left-to-right and top-to-bottom in the order I chose them.
At the end of this process, the shortcut presents me with a grid of the combined images in Quick Look, and I can choose to save it wherever I want. In another nice touch, you can also use this shortcut as a function of other shortcuts: if the shortcut runs with an input (meaning: you passed some images to it), images from the input will be merged in a grid and you won’t be asked to pick them manually.
Delete Old Files
This shortcut replicates the functionality of something I’ve long been doing with Hazel on the Mac: it routinely deletes old files that match a certain “expiration date” inside specific folders. Sadly, due to the lack of personal automations on macOS, this shortcut can only run on a schedule on iPhone and iPad for now, but I’m hoping this will change in macOS 13.
There are two essential actions in this shortcut, which are also the ones you’ll be asked to confirm at setup via import questions. First, an ‘Adjust Date’ action lets you specify what you consider an “old” file. By default, the action assumes that the creation date of the file has to be older than four weeks. You can change the timeframe to whatever you prefer, and you can also switch the shortcut to use the file’s last modified date rather than its creation date if you prefer.
Second, you have to point the shortcut at a folder that you want to routinely scan for old files, which you can do with the ‘Folder’ action at the very beginning of the shortcut. Once you’ve configured these two actions, you can run the shortcut and it’ll use the new Files/Finder actions in iOS 15 and macOS Monterey to evaluate every file inside a folder and, if its date is older than the threshold you specified, delete it. Files are deleted immediately without confirmation, which is also another option you can change in the ‘Delete Files’ action.
Someday soon, hopefully this action will be something we can run on a schedule on macOS. For now, you can set it up as a personal automation on iPhone or iPad and, say, periodically clean up Safari’s Downloads folder in the Files app.
EXIF Inspector
Another little-known detail of Shortcuts is that it can extract EXIF metadata from any image on your iPhone, iPad, or Mac by – and stay with me here – parsing the image as a dictionary. It may seem absurd at first, but it makes sense: EXIF metadata – which include details such as the timestamp of an image, its exposure value, which camera was used, and more – is a structured block of text with key:value pairs that indicate different aspect of an image and their values.
The shortcut I’ve put together to view these pieces of metadata, called EXIF Inspector, relies on the app’s ability to extract the {Exif}
value contained inside an image’s dictionary. As you can see below, it’s very simple to do:
After parsing the EXIF dictionary, the shortcut presents you with a list of all the keys in it; this is where you can choose which items you want to inspect and what kind of metadata you want to see for an image. You can choose multiple values from the list, and at the end you’ll see a single alert containing a summary of the categories you selected along with their respective values.
Thanks to iOS 15 and macOS Monterey, you can run EXIF Inspector from the share sheet or Finder’s quick actions; however, if the shortcut doesn’t have an input image, you’ll be automatically prompted to pick one from your Photos library, making this an effective way to quickly check out metadata for a photo you’ve recently saved.
Merlin’s Wisdom
A few months ago, my Internet pal Merlin Mann published the Wisdom Project – bits of advice that Merlin himself found useful in life based on his “own experiences and sensibilities”. The Wisdom is, effectively, a Markdown document published on GitHub with a long list of sentences about…life and other things.
I immediately found Merlin’s wisdom practical and useful, but I disliked having to open a GitHub repo to read Merlin’s advice and check out the latest modifications he made to the list. I also started wondering if I could make the experience of getting life advice from Merlin a bit more fun and randomized, so, obviously, I turned to Shortcuts.
My idea was simple: make a shortcut that would get a random item from Merlin’s list and present it in an alert. Since Merlin’s advice is a plain text file hosted on the open web, that was pretty easy to script with Shortcuts. What was challenging, but also the reason why I’m proud of my work here, was scraping the text document to account for Merlin’s (thankfully consistent) writing style. For instance, my shortcut automatically discards the introduction of the Wisdom file and tries to see if a random item has a ‘Related’ sub-item after it. If it does, you’ll be asked if you want to see to a related piece of advice Merlin has for you.
A lot of work went into matching text and related items with regex, iterating over items in a list, and designing menus and alerts in Shortcuts with natural language. I’m very happy with how seamlessly the shortcut works: you don’t see any of its underlying complexity and you can just click ‘Run’ and wait for Merlin to virtually whisper some advice back to you.
Of course, like any automation based on scraping and matching text, if Merlin ever decides to change the syntax he uses for the document, my shortcut will break and it’ll need to be updated. However, I have been running this shortcut for months, and Merlin has so far kept a consistent structure that has made the shortcut a pleasure to use every few days when I felt like I wanted to be reminded of a few important things in life.
Personally, I’ve gotten more value out of Merlin’s advice and this shortcut than several “meditation” subscription services I’ve tried over the years. Your mileage may vary. And remember: “it’s often easier not to be terrible”.
Toggle Up Next
This shortcut is a modified version of the one I shared two weeks ago to toggle the lyrics sidebar in the Music app for Mac. The difference: instead of toggling lyrics, it toggles the Up Next sidebar.
The shortcut is based on the same technique I explained before: it relies on a single Run AppleScript action to determine whether ‘Show Playing Next’ is available in the View menu of the Music app; if it is, it means the Up Next sidebar isn’t currently shown, so the shortcut simulates a click to display it. If the sidebar is already shown, the shortcut toggles it and hides it from view.
Related: both Toggle Lyrics and Toggle Up Next are based on UI scripting, which I learned thanks to UI Browser for Mac. Let’s pour one out for this amazing app that will be officially retired from sale later this year.
Toggle Up Next
Toggle the Up Next sidebar in the Music app for Mac on and off. The shortcut uses AppleScript and GUI scripting to determine whether the sidebar is shown or not.
Weather for Upcoming Events
A few weeks ago, I realized I was manually comparing events in my calendar that had a location attached with the forecast for that day in the selected location in CARROT Weather, and I started wondering if there was an easier way to do it that didn’t involve using two apps.
The shortcut I’ve come up with, called Weather for Upcoming Events, does exactly what I needed: it scans your calendar for events due in the next seven days that have a location attached; then, it shows you the forecast for that location on that day, so you can get a sense of what the temperature will be and when the sun will set, for instance.
I think this shortcut is a solid example of the many system integrations Shortcuts offers: events are fetched directly from Calendar and their dates are compared to the dates of the forecast returned from Weather; the shortcut effortlessly translates between locations and addresses with just a handful of actions, and I was able to put everything together via drag and drop and visual actions. It may be comprised of “just” 13 actions, but that’s precisely the point: automations don’t have to be complex to have a meaningful impact on your daily life.
Weather for Upcoming Events
Get the weather forecast for the location of an upcoming calendar event.
Reverse List of Links
I don’t remember the exact details of when I put this shortcut together last year, but I seem to recall I needed to grab links from a portion of a webpage in Safari and assemble a list of them in reverse order. It may have been related to when the Club MacStories archive used to be a webpage with a list of links for Mailchimp newsletters. I wanted to grab those links from the page and sort them in a new list from oldest to newest instead.
So, I created a shortcut that does this with just a few actions. The reason I’m sharing the shortcut is that the underlying list-reversing technique has broader implications: you can take advantage of this approach to reverse the order of any list of items in Shortcuts without relying on third-party actions. The idea is simple enough: to reconstruct a reversed list, the shortcut uses a repeat loop and the ‘Get Item from List’ action to get the last item of the list first, counting backwards until it reaches the first item via a combination of the ‘Calculate’ and ‘Set Variable’ actions.
You can use the shortcut I’m sharing to reverse a list of links selected on a Safari webpage; or, you can steal my technique and use it to reverse any list of any kind of items in your shortcuts. The choice is up to you.
Dot Exporter
The final shortcut I built for Automation April is a simple utility that lets you create a Markdown backup of a specific note from the Tot app as a document in Finder or the Files app.
John shared his own Tot Dot Review shortcut earlier this week, and after reading his story I realized that I also wanted a fast way to export individual dots from the app as Markdown files with a timestamp in their filename. That’s why I created Dot Exporter: when the shortcut runs, it’ll let you choose one of the seven dots from the Tot app that you want to export; then, the resulting file will be saved in a folder of your choosing.
The Markdown file that Dot Exporter generates contains the dot number and current date in the filename, which makes it easy to see, at a glance, which dot was backed up and when. If you make changes to your dots a lot, you could even run this as a scheduled automation; if you end up doing that, make sure to disable the ‘Ask Where to Save’ option in the final ‘Save File’ action and pick a folder where you’ll want your Tot backups to live.
Dot Exporter
Get a specific dot from the Tot app and export it as a Markdown file to the Files app or Finder.
You can follow MacStories’ Automation April coverage through our dedicated hub or subscribe to its RSS feed.