Like you-wouldn’t-believe-how-many other people, I still run an old Mac Mini with Snow Leopard on it. It’s been pretty reliable as an occasional music server and we still use it to play iTunes internet radio on AirPlay devices around the house. It also manages some backup tasks on my network. It runs headless and I access it through Screen Sharing when necessary.
It is more difficult then it used to be to remotely control Snow Leopard with AppleScript from newer operating systems. At one time, you could just address the machine and run commands with a username and password. Now you need to set up SSH. I haven’t done that and just use Screen Sharing.
But, believe it or not, the Run Script Over SSH action I described earlier works with Snow Leopard out-of-the-box. I will now set about creating a batch of Shortcuts to be able to quickly manage stuff on the Mac Mini with AppleScript, like playing a parrticular radio station in iTunes, shutting music down, changing AirPlay devices and so on, which I can call from my iPhone. Pretty cool.
I’m not particularly bowled over by Shortcuts on iOS. I just don’t use my iPhone and iPads rigorously enough that I’m inspired to automate many tasks. But I get that it’s a thing.
What I find very interesting however is that you can use Shortcuts to launch AppleScripts on a targeted Mac. So, while the “Music” actions on iOS are somewhat limited, there’s actually some potential usefulness in calling scripts (via Siri, even) from your iOS device to control iTunes on a Mac.
A nice basic tutorial by the great folks at Late Night Software explains how set this up. Essentially, you use the Run Script over SSH action to enter an osascript command to launch a script on a specified Mac. If you’ve ever done anything with launchd then you will recognize some similarities.
There are some limitations. First, AppleScript does not run on iOS. So anything you want to do with this technique will necessarily be on one particular Mac. (While I can imagine that it is possible to run other SSH commands from that Mac to other Macs, making all of that swing is beyond the scope of this article.)
Second, I am working strictly with scripting iTunes on a Mac. Many other apps on your Mac can be controlled with AppleScript, too.
Third, there is limited opportunity for user-interaction and feedback. (Depending on the use case, it is possible to manage some simple back-and-forth user-interaction in Shortcuts. But, again: beyond, scope, article.)
So, considering those parameters, there aren’t many iTunes track and playlist management things I’d want to do remotely; I’d prefer to be operating on track info while sitting in front of iTunes. But we can still use Shortcuts to perform some serviceable tasks with iTunes remotely, things that can’t be done conveniently with the Remote app on iOS.
Below, I describe how to create some Shortcuts that can launch scripts on your Mac. One will save the currently playing track to a “Favorites” playlist, another to change the AirPlay configuration and, lastly, one that pauses iTunes for five minutes. These may give you ideas for your own Shortcuts.
Back in the day, LP record albums were experienced as pairs of “sides”, right?
A decent record side was about 22 to 27 minutes long. And so we got used to listening to chunks of music of this duration. These time constraints on a record would often affect how the album was programmed, such as the song order and perhaps other conceptual factors.
If you spent a lot of time listening to record albums this way, you may remember the convention of “flipping the record” after the first side was finished in order to hear the other side. It only took a few moments to do so, but this pause in the action is the sort of thing you don’t experience much with CDs and virtually never with hours-long playlists.
I wondered what it would be like now to experience some of my classic digitized albums with a deliberate pause between the last song of one side and the first song of the next side. So, here’s Side Splitter.
It will copy a selection of tracks into separate user-designated “album side” playlists (by placing a checkmark next to the last song of a “side”) and then offer to auto-play them; when a “side” playlist stops, the script will offer to play the next “side” playlist, which you acknowledge by clicking an “OK” button the script shows in a dialog. When the entire album has played this way, the script will offer to delete the playlists.
It actually brings back that feeling of playing individual record sides.
A Space Between will play each track in the selected playlist and will wait (one might say insert but that’s technically incorrect) a user-set number of seconds between each. Play can commence at the “top” of the playlist or from a selected track.
NOTE: This script will only work as described when the “Up Next” queue is empty. You can use the “Clear” button” in “Up Next” to empty it of tracks. This is an issue with iTunes 12.2 and later.
Needle Drop is an applet that plays each track in the selected iTunes playlist for a set time interval optionally starting at a set number of seconds into each track, beginning with the selected track.
This latest version adds the “Start fade at seconds” option, which is the number of seconds from the end of the full duration to start fading iTunes’ volume for each track. Using the settings above, each track in a playlist would: 1) play for :30 seconds 2) starting at the :10 second mark, 3) begin fading at :24 seconds (30 – 6) and then 4) wait :03 before the next track begins.
Forgot to post about this a few days ago when I actually updated the script.
Now Where Was I? v2.0 is a simple applet that, when run while a track is playing or paused, will “remember” the current track and quit iTunes; when it is next run it will launch iTunes and play that track. If a track is set to “Remember playback position”, it will pick up playing from where it left off.
This latest version is generally updated for newer versions of iTunes and the Mac OS. More info and download is here.
A Space Between will play each track in the selected playlist and will wait (one might say insert but that’s technically incorrect) a user-set number of seconds between each.
A few extra seconds between tracks can provide a nice bit of atmosphere.
More information and download is on this page.
Quick Convert will convert all or just the selected tracks of the selected Playlist using your choice of available iTunes encoders, restoring your Preferences-set encoder afterwards.
Additionally, you can:
- Choose to delete and/or Trash the original tracks and/or files
- Copy all converted/imported tracks to a new playlist
- Optionally save AAC encoded tracks as M4B “bookmarkable” and re-add the converted files to the Audiobooks (Books) library
More information and download is on this page.
Play Random Album will quickly scan your library, create a playlist of a complete single album choosen at random and begin playback of the playlist created. Works great when assigned a keyboard shortcut. This is one of my favorite scripts.
More info and download is on this page.