4 min read

Using Spotify With a Stream Deck

Using Spotify With a Stream Deck

My table plays the vast majority of our sessions remotely over Discord. While this has many advantages, things can quickly become overwhelming. One of my major pain points was trying to manage all of the windows, especially when it came to triggering music to help set the scene.

To solve this, I ran out and bought a Stream Deck thinking that I could simplify my workflow at a push of a button. No more cycling through my embedded folders on Spotify to find the right playlist! Or so I thought.

The Problem

It turns out that Spotify doesn't play well with third parties trying to trigger and manage songs and playlists. The Stream Deck does have a Spotify Integration but its capability is limited to the following:

  • Play/Pause
  • Toggle Shuffle
  • Next Track
  • Previous Track
  • Volume

To further complicate things, I am on a Mac and so solutions like the Barraider approach weren't an option.

The Solution

⚠️
This solution only works on macOS.

Enter Apple Shortcuts! At its core, Apple Shortcuts is a way to automate tasks and workflows on your Mac.

Getting the Playlist ID

The first thing you need to do is get the unique ID associated with your playlist.

  • In the Spotify Mac App, navigate to the playlist you want to trigger.
  • Hit the three dots next to the download icon.
  • Go to Share > Copy link to playlist
💡
I went through and grabbed the URL for each of the playlists I wanted and dropped them into a text editor so that I could more easily grab the part that I wanted.

Creating the Script

Go ahead and launch Apple Shortcuts. A screen like below (though likely empty) will pop up.

  • Click the '+' at the top of the screen to create a new shortcut.
Creating a new shortcut
  • A new window will open.
  • On the right side of the window, search for Run AppleScript and select the first option.
Triggering a Spotify playlist with AppleScript
  • It will load a default script. Delete that.
  • In the text area, insert the following code. Replace the Spotify Playlist ID with your desired playlist that we got in the previous step.
tell application "Spotify"
	play track "spotify:playlist:<Your Playlist ID>"
end tell
  • Change the name (by clicking on it to edit) to be more descriptive.
  • Change the Icon (by clicking on it) if you wish.
  • With Spotify open, hit the play arrow at the top of the screen to test that it worked.  It should trigger the playlist to start playing.
💡
I found it very helpful to create a folder specific to these playlists. It helps in the next step.

Setting up the Stream Deck

  • Install the Apple Shortcuts Plugin for the Stream Deck.
  • Open the Stream Deck interface from the top menu bar on your desktop.
Opening the Stream Deck configurations
  • Drop in the new Launch Shortcut action.
The Shortcut action
  • Select the folder where you organized your playlists.
  • Select the shortcut relating to the playlist you want to trigger.
  • Add a picture or icon.
The Stream Deck action configuration
💡
I chose to leave the Title blank because the names of the playlists were in the icon image
  • Test the integration by pressing the icon on the Stream Deck.
⚠️
In order for the shortcut to trigger the playlist, Spotify must be open on your desktop. I minimize it before my session so it is out of the way.
Sometimes, when you press the button, you will get an error. I've found that clicking in the Stream Deck UI is sometimes needed. If that doesn't work, I have also had to re-set up a couple of the triggers.

Wrapping Up

That's it. You will have to rinse and repeat for each playlist you want to set up, but fortunately, Apple Shortcuts allows you to duplicate actions.

Using the same method, I have also triggered specific songs to add the needed punch to some of the more meaningful scenes.

This process does take a bit of up-front work but it has made things much smoother during my sessions.

Below you can see how my setup works.

💡
Use the existing Spotify plug-in to play, pause, and shuffle your playlist once it is playing.

Extra Credit

If you play on Discord I highly recommend using this in conjunction with KenkuFM. This is an awesome tool made by the same folks behind Owlbear Rodeo.

In order to make this work there is one additional step.

Because Kenku FM uses the Spotify player, you need to:

  • Open the Spotify app on your Mac.
  • Within the Spotify window in the KenkuFM app, you need to change the device that the music is playing on to This Web Browser.

Looking Forward

There are some obvious deficiencies to this approach. The primary one being that it only works on a Mac. In the future, if I outgrow my current use case (or if someone out there is so inclined), there is an API offered directly by Spotify.

I'm not sure how it would fit in with the workflow, but at least there is another option.