Posted By

schlaeps on 12/07/10


Versions (?)

iTunes Play Pause

 / Published in: AppleScript

Checks to see if iTunes is running and is playing / pausing a song and then does the opposite if it is.

  1. tell application "System Events"
  2. if (name of processes) contains "iTunes" then
  3. set iTunesRunning to true
  4. else
  5. set iTunesRunning to false
  6. end if
  7. end tell
  9. if iTunesRunning then
  10. tell application "iTunes"
  11. if player state is paused then
  12. play
  13. else if player state is playing then
  14. pause
  15. end if
  16. end tell
  17. end if

Report this snippet  

You need to login to post a comment.