Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Resume/Pause iTunes Downloads with AppleScript
# Resume/Pause iTunes Downloads with AppleScript
# Jedda Wignall
# For use with Ration:
# You will need to edit the row number on line 19 to match your settings in iTunes.
# Row 16 worked for me, but you may not have Podcasts or other lines displayed, so this could break it.
# Play around, and you should get it working. Maybe i'll edit this at some stage to do some more checking
# and select the right row automatically.
activate application "iTunes"
tell application "System Events"
if UI elements enabled then
tell application process "iTunes"
-- insert GUI Scripting statements here
click menu item "iTunes" of menu 1 of menu bar item "Window" of menu bar 1
select row 16 of outline 1 of scroll area 2 of window "iTunes"
click button "Resume All" of window "iTunes"
# uncomment for pause - click button "Pause All" of window "iTunes"
end tell
display dialog "GUI Scripting is not enabled" & return & return & "Open System Preferences and check Enable Access for Assistive Devices in the Universal Access preference pane, then run this script again." with icon stop
if button returned of result is "OK" then
tell application "System Preferences"
set current pane to pane ""
end tell
end if
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.