iTunes Play Pause


/ Published in: AppleScript
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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
  8.  
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.