Skip to content

Instantly share code, notes, and snippets.

@bmatheny
Created November 16, 2014 15:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bmatheny/4d9b5fab37ba588af312 to your computer and use it in GitHub Desktop.
Save bmatheny/4d9b5fab37ba588af312 to your computer and use it in GitHub Desktop.
usb overdrive spotify config
-- previous track
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
if is_running("Spotify") then
tell application "Spotify"
previous track
end tell
else if is_running("iTunes") then
tell application "iTunes"
previous track
end tell
end if
-- next track
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
if is_running("Spotify") then
tell application "Spotify"
next track
end tell
else if is_running("iTunes") then
tell application "iTunes"
next track
end tell
end if
-- play/pause
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
if is_running("Spotify") then
tell application "Spotify"
playpause
end tell
else if is_running("iTunes") then
tell application "iTunes"
playpause
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment