Created
April 24, 2015 11:51
-
-
Save tjluoma/6e9fd67fe0551dc5dee6 to your computer and use it in GitHub Desktop.
To use with TextBar (http://www.richsomerfield.com/apps/) save to a file and add `osascript /path/to/ShowSpotify.scpt` with an update of about 10 seconds
This file contains hidden or 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
-- submitted by Luca Zorzi lucazorzi.net | |
if application "Spotify" is running then | |
tell application "Spotify" | |
if player state is playing then | |
return "♫ " & (artist of current track as string) & " - " & (name of current track as string) | |
end if | |
end tell | |
end if | |
-- EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also put it all right into TextBar if you want to avoid using a separate file:
osascript -e 'if application "Spotify" is running then' -e 'tell application "Spotify"' -e 'if player state is playing then' -e 'return "♫ " & (artist of current track as string) & " - " & (name of current track as string)' -e 'end if' -e 'end tell' -e 'end if'