Advertisement
skororu

Automating backup of Flash drives

Nov 25th, 2013
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (*
  2. Original author:
  3. Constantinos C. Neophytou
  4. http://www.cneophytou.com/2007/03/06/automating-backup-of-flash-drives/
  5.  
  6. Amended original script to work with OSX Mavericks - skororu.deviantart.com
  7. *)
  8.  
  9. property backup_script : "rsync.app"
  10. property dialog_timeout : 30
  11.  
  12. on adding folder items to this_folder after receiving added_items
  13.     try
  14.         tell application "Finder"
  15.             try
  16.                 repeat with i from 1 to number of items in added_items
  17.                    
  18.                     set this_item to the item i of added_items
  19.                    
  20.                     if (kind of this_item is "Volume") then
  21.                         tell application "System Events" to set thefullpath to (POSIX path of this_item) & "/" & backup_script
  22.                        
  23.                         if exists thefullpath as POSIX file then
  24.                             set backupFile to POSIX file thefullpath as alias
  25.                             open backupFile
  26.                         end if
  27.                     end if
  28.                    
  29.                 end repeat
  30.             end try
  31.         end tell
  32.     end try
  33. end adding folder items to
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement