Monday, November 1, 2010

Adding Automation Through Folder Actions

At the office, I’m on a network and I have a Drop Box where my co-workers (freaks that they are) can send me files. However, for a long time, if a freak put something in my Drop Box, I wouldn’t know it unless they called or emailed me and told me so. But now anytime one of them drops something in my Drop Box, a message dialog appears that says, “Something freaky is in your Drop Box.” This is a simple AppleScript (think of an AppleScript as a built-in automation for your Mac, just like Photoshop actions add automation to Adobe Photoshop). Mac OS X includes some cool sample scripts (actions), or you can download about a bazillion from the Web for free.
To assign a script to a folder, Control-click on that folder and choose Configure Folder Actions from the contextual menu that appears. This brings up the Folder Actions Setup dialog, where you toggle various scripts assigned to folders on and off, or even edit scripts (if you know how to write AppleScripts). Click the plus sign (+) button at the bottom left of the dialog to add your folder to the list (this actually brings up a standard Open dialog showing your folder, so click on your folder in the dialog and click Open). Once you do this, a window will pop down with a list of built-in sample scripts you can assign to this folder, and their names give a cryptic description of what they do. Pick the one that sounds like what you want to do (to replicate my Drop Box warning, choose “add — new item alert .scpt”) and click the Attach button (you’ll see your newly assigned script appear in the column on the right of the dialog). Now click the Enable Folder Actions checkbox at the top-left corner of the dialog.This is a global on/off switch, so any folder to which you’ve attached scripts is now “activated.”
By the way, once you’ve applied actions to a folder, you can turn Folder Actions on or off globally by Control-clicking on any folder and choosing Enable Folder Actions or Disable Folder Actions from the contextual menu.

No comments: