Tuesday, October 5, 2010

OS X Folder Sync with Google Docs

Here is a little script that I adapted that allows you to assign a Folder Action that uploads anything you add to that folder to Google Docs. Here's how:

  1. Download google-docs-upload

  2. Create the script below in /Library/Scripts/Folder Action Scripts/transfer - Google Docs.scrp

  3. Right-click on a folder in finder and select Folder Actions Setup...

  4. Select the script and you are good to go!

  5. Now anything you put in that folder will be uploaded to Google docs!

on adding folder items to this_folder after receiving added_items
 repeat with aFile in added_items
  do shell script "java -jar /Users/OSX_USERNAME/Library/Scripts/google-docs-upload-1.3.2.jar " & quoted form of POSIX path of aFile & " --skip-all -u EMAIL_ADDRESS_FOR_GOOGLE_DOCS -p PASSWORD >> /Users/OSX_USERNAME/Library/Scripts/GDocs-upload-log.txt"
  end repeat
end adding folder items to

The script as-is will upload to your root folder in Google Docs, however, by adding the --remote-folder switch, you can specify where you want it to be. You could create a number of different scripts for different destinations.

Happy Birthday Angel!