This Week's Sponsor:

Kolide

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


Shortcuts Corner: Search YouTube, Preview Folder Contents, and Play Recent Music Albums

As I explained in today’s issue of MacStories Weekly for Club MacStories members, we’re bringing the newsletter’s Shortcuts Corner section to the site, with a twist: in this series, you’ll find simpler shortcuts that you can download for free, and which will be added to the public MacStories Shortcuts Archive; you’ll also get a preview of an exclusive shortcut available today for Club MacStories members.

In this week’s Shortcuts Corner, I share shortcuts to quickly launch a search query in the YouTube app, preview the contents of a folder in iCloud Drive, and start playback for one of your recently played albums in the Music app. Let’s dive in.

Search YouTube

Since I created this simple, three-action shortcut a few weeks ago, it’s become one of my most used automations: with this shortcut, you can type a search query in an ‘Ask for Input’ dialog, then tap ‘OK’, and the selected search will open in the YouTube app for iPhone or iPad.

Searching YouTube from Shortcuts.

Searching YouTube from Shortcuts.

As you can see from the screenshots above, the YouTube app can do this by adding youtube:// before a standard youtube.com URL – in this case, the URL to open a search results page. You can search for both videos and channel names with this shortcut, and results will be displayed in the YouTube app. Thanks to conversational mode in iOS and iPadOS 13.1, you can also ask Siri to search for videos, and the assistant will launch the YouTube app.

I’ve been using this shortcut to quickly launch searches in YouTube so often, I’ve added it to my iPhone and iPad Home screens using MacStories Shortcuts Icons. You can read more details on MacStories Shortcuts Icons here and buy them directly here.

The top section of my iPadOS Home screen, featuring MacStories Shortcuts Icons.

The top section of my iPadOS Home screen, featuring MacStories Shortcuts Icons.

You can download the ‘Search YouTube’ shortcut below and find it in the MacStories Shortcuts Archive.

Search YouTube

Type a search query and open search results in the YouTube app. The shortcut supports both keyboard input and conversational mode in Siri.

Get the shortcut here.

Preview Folder Contents

I originally created this shortcut to more easily search the contents of the MacStories Shortcuts Icons folder, but it can be repurposed to work with any folder stored in iCloud Drive/Shortcuts.

Here’s the idea: if you have a folder containing documents you want to quickly search or preview, you can use this shortcut to bring up a preview for all the items in the selected folder. You can filter items by name beforehand; if you leave the search dialog empty, the shortcut will preview all the files contained in the folder.

All the contents of a folder (left) can be previewed inside the Shortcuts app.

All the contents of a folder (left) can be previewed inside the Shortcuts app.

Due to sandboxing limitations in the Shortcuts app, the folder has to be placed in Shortcuts’ own documents directory in iCloud Drive. As I argued in my iOS and iPadOS 13 review last week, Apple should get rid of these limitations, but we’re stuck with them for now. For this reason, I recommend this shortcut to preview the contents of folders you frequently access, and which you wouldn’t mind storing as sub-folders inside the Shortcuts directory (such as MacStories Shortcuts Icons).

Shortcuts can return the full contents of a folder thanks to the ‘Get File’ action: if the action does not point to an individual file, it’ll pass back a list of all files contained in a folder instead.

Reading the contents of a folder with Shortcuts.

Reading the contents of a folder with Shortcuts.

Furthermore, the rich preview generated by the ‘Choose from List’ action changes depending on the files you’re previewing: if it’s a folder of images, ‘Choose from List’ will display a grid of image thumbnails; if they are text files or .zip archives, you’ll get a plain list instead. At the end of the shortcut, you’ll be able to preview a single selected file with Quick Look or share it with other apps via the share sheet.

You can preview or share a selected file.

You can preview or share a selected file.

I’ve been using this shortcut to preview the contents of different folders I store in iCloud Drive/Shortcuts; ideally, Apple should allow Shortcuts to read the contents of any folder in any file provider regardless of its location, but this will do for now.

You can download the ‘Preview Folder Contents’ shortcut below and find it in the MacStories Shortcuts Archive.

Preview Folder Contents

Preview the contents of a folder stored inside iCloud Drive/Shortcuts. The shortcut lets you filter items by name; if no name is entered, all files contained in the folder are returned. You can choose to preview a selected file with Quick Look or share it with extensions.

Get the shortcut here.

Play Recent Music Albums

This shortcut is exclusive to Club MacStories members and has been published in today’s issue (#193) of the MacStories Weekly newsletter.

The Shortcuts app doesn’t offer built-in Music actions to find your recently played albums, mirroring what the Music app shows in the ‘Recently Played’ section of the For You page. So I built my own custom shortcut to work around this limitation and start playing albums I’ve recently been listening to. With a couple of taps, I can now get a list of songs I listened to and immediately play the full album.

Playing recent albums with Shortcuts.Replay

There were some decisions I needed to make when building this shortcut to work around other limitations of the Shortcuts app. To download this shortcut and read my technical explanation of how it was built, subscribe to Club MacStories and check out Issue 193 of MacStories Weekly, either in your email inbox or the Newsletter Archive.


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.