Created
May 14, 2017 10:01
-
-
Save robotsandcake/bae13f6ff8af88567892806f5a6342d4 to your computer and use it in GitHub Desktop.
This AppleScript when used in conjunction with DragonDictate for Mac will play/pause the current iTunes track.
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
| try | |
| -- Specify the application will want to work on, in this case iTunes. | |
| tell application "iTunes" | |
| -- Get iTunes current state | |
| if player state is paused then | |
| -- If iTunes is paused, press play. | |
| play | |
| -- Get iTunes state if it doesn't match the first condition | |
| else if player state is playing then | |
| -- If iTunes is playing, press pause. | |
| pause | |
| end if | |
| end tell | |
| end try |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment