AppleScript: Using Folder Actions to Sync Folders

AppleScript is so fun! That and Folder Actions are two of the reasons I love OS X.

So I recently had something come up where I had to make sure anything that was copied into one folder was immediately copied into another. Folder Actions made this simple.. now I haven’t added the functionality to make sure that anything that’s deleted from the master folder gets deleted in the Sync Folder but this script is good enough.

 
I saved this code as an .scpt file in /Library/Scripts/Folder Action Scripts, attached it to a folder and I was set.

Chrissy is a PowerShell MVP who has worked in IT for nearly 20 years, and currently serves as a Sr. Database Engineer in Belgium. Always an avid scripter, she attended the Monad session at Microsoft’s Professional Developers Conference in Los Angeles back in 2005 and has worked and played with PowerShell ever since. Chrissy is currently pursuing an MS in Systems Engineering at Regis University and helps maintain RealCajunRecipes.com in her spare time. She holds a number of certifications, including those relating to SQL Server, SuSE Linux, SharePoint and network security. She recently became co-lead of the SQL PASS PowerShell Virtual Chapter. You can follow her on Twitter at @cl.

Posted in OS X & iPhone
3 comments on “AppleScript: Using Folder Actions to Sync Folders
  1. anthony says:

    does this include the folder's sub folders???

  2. quaid says:

    want it to work but get expected end of line but found unknown token from the do shell script line

  3. brian says:

    syntax error in do shell script line “expected end of line”

Leave a Reply

Your email address will not be published. Required fields are marked *

*