Skip to content

Instantly share code, notes, and snippets.

@gdiggs
Created July 28, 2011 20:16
Show Gist options
  • Save gdiggs/1112446 to your computer and use it in GitHub Desktop.
Save gdiggs/1112446 to your computer and use it in GitHub Desktop.
Get current track and link in Spotify
tell application "Spotify"
set track_name to name of current track
set track_artist to artist of current track
set track_album to album of current track
set track_id to id of current track
end tell
set AppleScript's text item delimiters to ":"
set track_id to third text item of track_id
set AppleScript's text item delimiters to {""}
set message to "'" & track_name & "' by " & track_artist & " on '" & track_album & "' - http://open.spotify.com/track/" & track_id
return message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment