Skip to content

Instantly share code, notes, and snippets.

@hansv
Last active December 18, 2015 19:29
Show Gist options
  • Select an option

  • Save hansv/5833097 to your computer and use it in GitHub Desktop.

Select an option

Save hansv/5833097 to your computer and use it in GitHub Desktop.
Very naive implementation of pausing Rdio and iTunes when they are playing. Now checks to see if the apps are running.
if application "Rdio" is running then
tell application "Rdio"
try
set whatshappening to (get player state as string)
end try
if whatshappening = "playing" then
pause
end if
end tell
end if
if application "iTunes" is running then
tell application "iTunes"
try
set whatshappening to (get player state as string)
end try
if whatshappening = "playing" then
pause
end if
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment