Skip to content

Instantly share code, notes, and snippets.

@ytsutano
Created October 28, 2012 19:46
Show Gist options
  • Save ytsutano/3969648 to your computer and use it in GitHub Desktop.
Save ytsutano/3969648 to your computer and use it in GitHub Desktop.
Automator: sync all iOS devices.
on prepareGrowl()
tell application "Growl"
set the allNotificationsList to {"iTunes"}
set the enabledNotificationsList to {"iTunes"}
register as application "iTunes" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "iTunes"
end tell
end prepareGrowl
on notify(messageTitle, message)
tell application "Growl" to notify with name "iTunes" title messageTitle description ¬
message application name "iTunes"
end notify
on run {input, parameters}
prepareGrowl()
tell application "iTunes"
set deviceNumber to 1
repeat with s in sources
if kind of s is iPod then
set title to (deviceNumber as text) & ". " & (name of s)
set message to "Started syncing..."
try
update s
on error errText
set message to "Sync failed." & return & return & errText
end try
my notify(title, message)
set deviceNumber to deviceNumber + 1
end if
end repeat
end tell
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment