Last active
December 18, 2015 19:29
-
-
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.
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
| 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