Convert a Spotify Share URL to an URL Scheme with Launch Center Pro, Drafts, and TextTool

Home

This post was originally published on my Postach.io blog on January 16th, 2015.

I have been using Workflowy as a place to store Spotify launch URLs. When I tap on Share to copy an artist, album or track link in the Spotify for iOS app, I get the link in a format like http://open.spotify.com/artist/2TI7qyDE0QfyOlnbtfDo7L (which is the artist URL for the Dave Matthews Band). I have been copying this URL into Workflowy, and then when I’m at a desktop I manually change it to launch://?url=spotify:artist:2TI7qyDE0QfyOlnbtfDo7L so that I can tap on the link and have it open directly to his page in the Spotify iOS app. But I’m tired of that, so I wrote a script to convert the URL. This requires Drafts, Launch Center Pro, and TextTool. I should warn you off the bat that the following makes use of Drafts 3. If you are using the most current version of Drafts, you will have to adapt the URL scheme. Also, this will not work for playlists.

First, the LCP URL action. Install it directly, or paste this into a new action:

texttool://x-callback-url/transform?text=[clipboard]&method=split&delimiter=%2F&x-success={{drafts:///create?text=[[output]]&action=spotify-share}}

Then import this Drafts URL action or create an URL action called spotify-share:

drafts:///create?text={{launch://?url=spotify:[[line|4]]:[[line|5]]}}

After you’d done all the above, just copy a share URL to your clipboard, tap on the LCP action, and get the converted URL in Drafts. Then you can use that launch URL wherever you want.