Playing a podcast by time of day using “If” conditionals

Playing a podcast by time of day using “If” conditionals

This afternoon, @kcjokes asked for a shortcut that can play a podcast based on the time of day:

After thinking about it for a minute, I built this for him:

Takes the current time, converts it to 24-hour time, then grabs just the Number value and uses it in an “If” conditional – if before 8pm (or 20), play podcast “A”, otherwise if after 8pm play podcast “B.”

Includes Import Questions for pre-selecting the podcasts.

This is a helpful example of using the “If” action to create conditionals in your shortcuts, letting something different happen each time you run the shortcut depending on how the condition is met. In this, the shortcut uses the current Time values inside “If” conditionals so that something different happens depending whether the shortcut is run before or after a certain time of day.

To be more specific, formatting the Time into a single 24-hour value lets the “If” action’s conditions utilize “less than” or “equal to”-type math to check against the current hour – in iOS 13, the “If” action’s conditions change depending on the type of content used.

Feel free to give it a more creative name 🙂

Get the shortcut or view the full screenshot.

Posts You Might Like

The must-try iPhone shortcut to help you remember everything »
The must-try iPhone shortcut to help you remember everything »
Kurt Knutsson has written about Apple’s “Remember This” shortcut – an excellent starter shortcut for anyone trying to learn the app.
If Apple wants its headset to win, it needs to reinvent the app »
If Apple wants its headset to win, it needs to reinvent the app »
David Pierce of The Verge takes a look at Apple's approach to apps in lieu of a rumored headset – and how the ecosystem needs to change.
New shortcut: Crop Podcast Artwork with Pixelmator
New shortcut: Crop Podcast Artwork with Pixelmator
Built for linking to podcasts mentioning my work, this shortcut uses Apple Podcasts and Pixelmator Pro for Mac to perform a ML crop on the show artwork to generate a 16x9 image for a blog post.
Why the Menu Bar is the best way to get started with Shortcuts for Mac
Why the Menu Bar is the best way to get started with Shortcuts for Mac
Shortcuts for Mac lets you run shortcuts from the Menu Bar. Here's how to set it up, optimize your shortcuts, and add advanced interactivity for your macOS experience.