dougscripts.com

March 20 2026 - 12:23 pm

The Bathroom Music Server

I've mentioned my Bathroom Music Server on The Next Track Podcast and other places so I thought I'd tell a little about it.

First of all: you know how when you're at the market and you hear music playing over the speakers? You did not enter the market to hear music, but There It Is. Or when you're drivin' down the Mass Pike and you gotta make a pitstop just west of the Middle of Nowhere in Blandford and there's music playing in the lav'? You did not enter the lav' to hear music, but There It Is. Or when you go get a haircut at Tony's. You did not enter Tony's to hear non-stop Italian Opera, but There It Is.

And then think of all the music that's playing in those places that you don't hear because you're not there...oh man, existential!

I wanted to re-create this sensation in my own Domicile. I wanted to suddenly encounter randomly playing music so as to cause my brain to go "Hey, they're playin' ZZ Top in here right now!"

Now most all the rooms in my house are out-fitted for intentional listening. There's no way I don't know what's playing at any given time. However, there is no music in the bathroom. Pretty sure my Mom drilled that in to me.

Perhaps subconsciously I am disobeying my Mom.

You see, one must use the bathroom from time to time. You are compelled to go there by forces beyond your will power. And it is not a room for leisure. And you do not go to the bathroom primarily to listen to music. Perfect.

I happen to have the last Intel Mac mini model that positively flies with Monterey and I wasn't doing anything with it. So I shoved it into a bathroom cabinet, hooked it up to a D-class amp and a pair of little Pyle speakers and got to work.

The Intel Mac mini has no monitor, so it has to run headless via Screen Sharing with one of my other Macs. And this enabled me to set up a minimal desktop environment with just the Music app and a folder or two open.

I wanted music playing in the bathroom every day between 7AM and 8PM. The easiest thing to do in that regard was to schedule the Mac mini's Startup and Shut Down times to those hours. I could have written a script that started and stopped the music at the appropriate times but 1) too much math and 2) I had another idea for a script. I wrote an applet that is set in Login Items, so when the Mac mini starts up, the applet launches. The applet waits five minutes for all the start up stuff to complete; longer than necessary but safely out of the way of any launch activity. Then it talks to the Music app.

It tells the Music app to delete all the tracks in a particular Smart Playlist. This live-updating Smart Playlist has rules about what kind of tracks to play: songs of particular Genres, between 2:00 and 8:00 minutes long, not played in six weeks, and so on. When you delete the tracks of a live-updating Smart Playlist, it immediately re-populates with new tracks dynamically. Fresh tracks every day!

I forgot to mention that the Mac mini has been loaded with all of my local music files from one of my Macs. It does not connect to Apple Music, no streaming, no sync'ing. When I add new audio files to my main Mac, I also copy them over to the Mac mini and add them to the Music app there.

Back to the script: once the Smart Playlist has been reconfigured, the applet tells that playlist to start playing. And we have music playing in the bathroom all day. Most of which I will never hear.

(I have recently incorporated the Block Party Weekend player to launch on Saturdays and Sundays, which provides a Triple-Shot Weekend every weekend.)

Lastly, the script creates a daily log of the songs that have played, kept for five days. If it happens that I can remember the day and time I heard a song that fascinated me I can look it up in the logs. I think I've done that once. And one other thing, a gripe: can't hear music when I'm using my electric toothbrush. Miss a lot of two minute songs brushing my teeth.

Site contents © 2001 - 2026 (that's right: 2001) Doug Adams and weblished by Doug Adams. Contact support AT dougscripts DOT com. About.
All rights reserved. Privacy.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no direct affiliation with Apple, Inc.
The one who says "it cannot be done" should not be interrupting the one who is doing it.