Skip to content

Instantly share code, notes, and snippets.

@tjluoma
Created April 24, 2015 11:51
Show Gist options
  • Save tjluoma/6e9fd67fe0551dc5dee6 to your computer and use it in GitHub Desktop.
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
-- 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
@tjluoma
Copy link
Author

tjluoma commented Apr 24, 2015

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment