Created
May 3, 2009 19:33
-
-
Save nagubal/106124 to your computer and use it in GitHub Desktop.
Applescript to backup iTunes library to syno
This file contains hidden or 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
| -- Sauvegarde de la librairie iTunes sur le synology via rsync | |
| property appName : "Sauvegarde iTunes" | |
| property rsyncUri : "rsync://syno:22/music/" | |
| property iTunesFolder : "/Users/anthony/Music/iTunes" | |
| on tellGrowl(myid, myTitle, myMessage, isSticky) -- the growl notification routine | |
| global growlIsRunning | |
| if growlIsRunning then -- is growl running? | |
| tell application "GrowlHelperApp" | |
| if isSticky then | |
| notify with name myid ¬ | |
| title myTitle ¬ | |
| description myMessage ¬ | |
| application name appName ¬ | |
| with sticky | |
| else | |
| notify with name myid ¬ | |
| title myTitle ¬ | |
| description myMessage ¬ | |
| application name appName | |
| end if | |
| end tell | |
| end if | |
| end tellGrowl | |
| tell application "System Events" | |
| set growlIsRunning to (count of (every process whose name is "GrowlHelperApp")) > 0 | |
| end tell | |
| if growlIsRunning then | |
| tell application "GrowlHelperApp" | |
| set the allNotificationsList to {"Done", "Start"} | |
| set the enabledNotificationsList to {"Done", "Start"} | |
| register as application appName ¬ | |
| all notifications allNotificationsList ¬ | |
| default notifications enabledNotificationsList ¬ | |
| icon of application "Time Machine" | |
| end tell | |
| end if | |
| tellGrowl("Start", appName, "Sauvegarde de la librairie iTunes... | |
| Ne PAS éteindre ou déconnecter le disque avant la fin de la sauvegarde!", true) | |
| set output to do shell script ("rsync -aul --delete --stats --exclude=.DS_Store " & iTunesFolder & "/* " & rsyncUri) | |
| tellGrowl("Done", appName & " terminée", output, true) | |
| tell me to quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment