But that wouldn’t be a great use of what Shortcuts has to offer with its visual automation on iOS. In theory, I could have built a shortcut that played a specific playlists and duplicated it multiple times, changing the name of the playlist in each version. With AppleScript and iTunes, four lines of code are all it takes to start playing a specific playlist on shuffle: tell application "iTunes" Over the years, I’ve been curating a selection of playlists I like to listen to either by myself, with my girlfriend, or when we have friends over at our place. Toggle the player state of the iTunes app on a Mac on the same local network as your iOS device. This is particularly nice when combined with the next shortcut. With this shortcut, I have a one-tap solution to resume iTunes’ playback on all the speakers it was previously connected to without having to manually select them each time. Unlike Control Center on iOS, iTunes on the Mac always remembers the last AirPlay speakers it was connected to (even across restarts) as well as their individual volume levels. Thanks to osascript, this shortcut checks the player state of iTunes and either pauses it (if it’s already playing) or starts playing (if it’s paused). This is an obvious one: I wanted a super-fast shortcut to instantly play or pause iTunes (which is usually sending audio to three HomePods at once) from either the Shortcuts widget on iOS or Siri. With iTunes, I can write AppleScripts that play Apple Music items from my library on specific HomePods/AirPlay 2 speakers therefore, all these scripts can be triggered from Shortcuts on iOS and chained together in a multitude of interesting ways. Yes, Apple’s music player/media manager gets a bad rap (and rightfully so the app is a mess), but it’s got one thing going for it still: iTunes has extensive integration with AppleScript, including actions that can connect to AirPlay speakers and set their volume to play a specific song, album, or playlist. It may sound anachronistic in 2019, but one of the advantages of having a Mac mini always running and multiple HomePods around the house is iTunes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |