Media Shortcuts

Shortcuts can do a lot with media, which includes music, images, and more. Here are a few examples of what you can do with the media-related actions.

Convert and Share Image

By default, photos we take on our devices are in HEIC format—and they’re extremely large. If we want to share them, some of our apps convert them automatically for us and even resize them. For consistent results, though, we can use a shortcut:

  1. Right after creating the Shortcut, tap the More icon, and enable Show in Share Sheet. Change Share Sheet Types and Deselect All before you select Images.

  2. Add an If action and delete the Otherwise section.

    The first part of this is set to Shortcut Input, and we need to change Condition to has any value.

  3. After the If but before End If, add a Select Photos action.

    This runs only if you don’t use your shortcut from the Activity View (so if you don’t share an image to it). It outputs either what you shared to the shortcut, or what you just selected.

  4. After the End If statement, add a Convert Image action.

    This should automatically update to Convert If Result to JPEG. Tap Show More and slide down the Quality to an appropriate level (see Figure 51). Preserve Metadata tells Shortcuts whether it should keep data like the location attached to the image.

    Figure 51: Convert and set the quality of an image.
    Figure 51: Convert and set the quality of an image.
  5. Add a Share action.

    This is automatically changed to Converted Image.

  6. Tap Next, give the shortcut a name and icon, and tap Done.

Install Convert & Share Image shortcut: https://alt.cc/shci

Play Audio

I use this shortcut with two automations: when I connect to CarPlay, and when I connect to bluetooth devices (my AirPods). With just a few taps, I can tell my device to play music or a podcast.

Here’s how to build this shortcut:

  1. Add a Choose from Menu action.

    Change “One” and “Two” to Music and Podcast and add a third option Cancel.

  2. Under the Music option, add a Get Current Song action.

  3. Under “Get current song,” add an If action and delete the Otherwise.

    Make sure your If uses Current Song as the input and set the condition to does not have any value.

  4. Right under If [Current Song] [does not have any value], add the action to Get Playlist.

    Choose a playlist to get the songs from.

  5. After End If (but before Podcast), add a Play Music action.

    This should automatically use If Result as the song to play. Because we deleted the Otherwise step, if there is a current song that is passed through, and if not then a song from our playlist is played.

  6. Under the Podcast option, add a Get Podcasts from Library action.

  7. Beneath Get Podcasts from Library, add a Choose from List action.

    Set the List to Podcasts if Shortcuts doesn’t set it automatically.

  8. Below Choose from Podcasts, add a Play Podcast action.

    Set the Podcast to the Chosen Item (from step 7), if it isn’t set automatically.

  9. After Cancel but before End Menu, add an Exit Shortcut action.

  10. Add Set Playback Destination as the very last action, after End Menu.

    Tap the type of your device (e.g. iPad) and change it to Ask Each Time.

  11. Tap Next, give the shortcut a name and icon, and tap Done.

Install Play Audio shortcut: https://alt.cc/shpa

Set AirPods Pro Noise Cancelling

When I want to change the noise cancelling on my AirPods Pro, the last thing I want to do is to dive into Settings, Bluetooth, etc. If your devices are set up to change when you press and hold the stems, this shortcut may be less useful, but you can still include the primary action in other shortcuts—such as the audio playback example above.

There are two ways to approach this, and I detail both here.

Let’s look at the one-action version first:

  1. Add the Set Noise Control Mode action.

    Set Route to your AirPods Pro if Shortcuts doesn’t do this automatically. (You may need to open your AirPods Pro case and hold it open near your device to be able to do this.) Set the Noise Control Mode to Ask Each Time.

  2. Tap Next, give the shortcut a name and icon, and tap Done.

Install Set AirPods Pro Noise Cancelling (menu) shortcut: https://alt.cc/sham

This shortcut works perfectly, but it opens Shortcuts every time you run it. If you prefer, you can change the shortcut to use a menu instead (Figure 52 illustrates the difference).

Figure 52: Ask When Run vs. a Menu Action.
Figure 52: Ask When Run vs. a Menu Action.

Using a menu instead of Ask Each Time offers multiple advantages:

  • Shortcuts does not open when you run the app from the Today widget.

  • You can choose your option with Siri, and don’t need to touch your device to control it.

To make the menu version of this shortcut:

  1. Add a Choose from Menu action.

    Change “One” to Transparency and “Two” to Noise Cancelling.

  2. Right under Transparency, add a Set Noise Control Mode action.

    Set the Route to your device (if not done automatically) and the Noise Control Mode to Transparency.

  3. Under Noise Cancelling, add a Set Noise Control Mode action.

    Set the Route to your device (if not done automatically) and the Noise Control Mode to Noice Cancelling.

  4. Tap Next, give the shortcut a name and icon, and tap Done.

Install Set AirPods Pro Noise Cancelling (ask for each) shortcut: https://alt.cc/shaa

Add Current Song to Playlist

I have been exploring Apple Music’s playlists recently and keep finding great songs I want to listen to again, but I’m much too lazy to add these to my playlist My Music Library by hand, so I built a Shortcut to do it for me!

Here are the two actions we need:

  1. Add a Get Current Song action.

  2. Add an Add Song to Playlist action.

    This should automatically select the Current Song from step 1, and then choose an appropriate playlist (Figure 53).

  3. Tap Next, give the shortcut a name and icon, and tap Done.

Figure 53: Add current song to playlist.
Figure 53: Add current song to playlist.

Install Add Current Song to Playlist shortcut: https://alt.cc/shcs

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset