Mac's OSA Script is pretty neat. It's a handy way of controlling applications on your machine programmatically.
To get Spotify to play a song with a simple command, paste the following into your ~/.bash_aliases
file.
alias pump="osascript -e 'tell application \"Spotify\" to play track \"spotify:track:3KliPMvk1EvFZu9cvkj8p1\"' end tell"
You can copy the "Spotify URI" of any song by right-clicking the track in Spotify.
Start a new terminal session, then type: pump
. Your song should start playing!
Software engineer by profession, embedded systems tinkerer, husband, father, fantasy novel devourer, wine lush, beer and cheese connoisseur