Created
March 16, 2013 13:05
-
-
Save oderwat/5176287 to your computer and use it in GitHub Desktop.
Quick and Dirty "Fetch current running Title from Spotify to Clipboard" for usage as LaunchBar Action (can easily be modified for other Launchers)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
tell application "Spotify" | |
set theTrack to name of the current track | |
set theArtist to artist of the current track | |
set theAlbum to album of the 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 realurl to ("http://open.spotify.com/track/" & track_id) | |
set theString to theTrack & " – " & theArtist & ": " & realurl | |
open location "x-launchbar:large-type?string=" & theTrack & "\n" & theArtist | |
set the clipboard to theString | |
on error | |
open location "x-launchbar:large-type?string=No Track found!" | |
end try |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment