Created
October 28, 2012 19:46
-
-
Save ytsutano/3969648 to your computer and use it in GitHub Desktop.
Automator: sync all iOS devices.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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