Skip to content

Instantly share code, notes, and snippets.

@shenie
Created January 31, 2010 07:38
Show Gist options
  • Save shenie/290953 to your computer and use it in GitHub Desktop.
Save shenie/290953 to your computer and use it in GitHub Desktop.
iTunes applescript
osascript -e 'tell app "iTunes" to set sound volume to sound volume +20'
osascript -e 'tell app "iTunes" to next track'
osascript -e 'tell app "iTunes" to previous track'
osascript -e 'tell app "iTunes" to playpause'
osascript -e 'tell app "iTunes" to play'
osascript -e 'tell app "iTunes" to pause'
osascript -e 'tell application "iTunes" to return name of current track'
osascript -e 'tell application "iTunes" to set song repeat of current playlist to one'
osascript -e 'tell application "iTunes" to set shuffle of current playlist to not shuffle of current playlist'

tell application "iTunes"
        tell first library playlist to set shuffle to not shuffle
end tell

Notes:

  • The setting in volume command is incremental, i.e. in the example it will increase volume by 20. So to reduce volume just replace + with - sign.
  • The rating range from 0 to 100 (1 to 5 stars), so you can actually set half stars which iTunes will display correctly but there is no way of setting half stars vis the UI.
  • The mute command will toggle the mute button
  • The repeat value can be off, one or all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment