Opening Spotify links directly in the desktop app
I recently discovered a solution to an annoyance that has nagged at me for years.
Because Spotify Share links — e.g., the ones you get when clicking •••
-> Share
-> Copy Album Link
— are HTTPS URLs, they open in your browser, not in the Spotify desktop app.
This means that whenever I click these links, which I do quite often, I have to do a little dance to open the album in the desktop app instead and then close the extraneous browser tab.
I searched for fixes to this an embarrassing number of times before finally discovering that this does what I want (on macOS):
open "spotify:album:2Kwbn1H4KMGZAe4MS6uDzU"
That’s a Spotify URI, and the desktop app registers itself as a handler of that URI pattern. I didn’t think this would work because it doesn’t look like any other URI I’ve seen, but now I know!
What to do, though, now that I made a pantload of music notes with the HTTPS links instead of the URIs? Well, first I made an Alfred workflow to extract the relevant bits from a Spotify HTTPS URL, assemble the URI, and open it. Using this, I select the text including the URL and run my workflow as a universal action. That works well.
I also updated my script that generates those music notes to include both the HTTPS link and the URI link, like so:
[Spotify (web)](https://open.spotify.com/album/7xBJ2XXlDFfACXAnOE86t8) | [Spotify (app)](spotify:album:7xBJ2XXlDFfACXAnOE86t8)
Problem solved!