As Apple describes it, “Folder Actions is a feature of Mac OS X that lets you associate AppleScript scripts with folders. A Folder Action script is executed when the folder to which it is attached is opened or closed, moved or resized, or has items added or removed. The script provides a handler that matches the appropriate format for the action…..”
What they are saying is that by setting up a Folder Action, you can run a script whenever any of the following occur:
- the attached folder is opened
- the window of the attached folder is closed
- the window of the attached folder is moved or resized
- items are placed into the attached folder
- items are removed from the attached folder
What we’re going to show you here is how to use a folder action to make a folder that, when you drop an image file into it, will attempt to convert it to another format, in case you like to save all your images in the same format.
To start with, in Finder go to the location you want to create your “Drag and Drop” folder and right-click and select New Folder:

Rename the folder as you like (we called it “Convert to PNG”) and then right-click on the newly created folder and select “Enable Folder Actions” (note that you may have to navigate through the “More” selection, as shown here):
Once you have done that, right click on the folder again, and this time select “Attach a Folder action…”
A file picker will appear - you want to navigate to /Library/Scripts/Folder Action Scripts/ (note this is off your primary drive’s root folder, not your user folder) and then click on Choose:
Once you’ve chosen the Folder Action Scripts directory, choose the actual script to associate with the folder. In this case we’ve chosen Image - Duplicate as PNG.scpt:
Now drag an image to the folder that’s not already a PNG (such as a GIF or JPG) and it should be converted to PNG. The original is not deleted, so you should find both inside the folder. As you may have noticed, there are also scripts that will “Duplicate as JPEG” and “Duplicate as TIFF”, so the possibilities exist to make “Drag and Drop” folders for those formats as well.
This just scratches the surface of what Folder Actions can do. Apple’s site has a section on Folder Actions, including a page showing how you can write your own Folder Action Scripts, and descriptions of the Folder Action Scripts found in /Library/Scripts/Folder Action Scripts/.
Apple’s site also has a couple of additional Folder Action Scripts that you can download and use if you wish. They are:
Archive Added Items - This script will make an archived copy, in ZIP format, of the individual items added to the attached folder. Archived files are placed in folder named “Done” within the attached folder.
Auto-backup Script - This script will automatically backup specified items any time a particular hard drive is mounted on the desktop.
In addition, if you search the web you can find other Folder Action Scripts that people have created.
We would be remiss if we did not mention that this is the Apple way to do things, and it’s always possible to do things differently. For example, in an article entitled “Use launchd to replace folder actions” at Mac OS X Hints, the author of that article notes that “Folder actions are quite slow, and on 10.5.x, I found them to be not really fun to play with. Another way to watch a folder is to create your own launchd script.” He then goes on to explain how to do that, though admittedly we didn’t quite follow what he was doing. He still winds up calling an AppleScript, but he uses a launchd script to actually watch the folder, and since our most recent previous article was about Lingon, which assists in creating launchd scripts, we thought we’d at least mention it so that the “true geeks” could try their hand at using that technique. As for us, we probably aren’t going to care all that much if it takes the Mac an extra second or so to notice that we dropped something into a folder!




