Take a picture with the iSight camera when a folder is opened
Thu, Jan 21 2010 at 7:30AM PST • Contributed by: puzzlebobble
This script describes an AppleScript that uses Imagesnap, a public-domain command line tool, to take a photo with the built-in iSight camera when a specified file is opened. It saves the photo as a JPEG with a filename based on the time/date, and then hides the JPEG. The light by the side of the camera will flash briefly when the snap is taken.
This hint could be very easily adapted to run lots of different functions, for example taking a screen shot. Before writing this script, I had not realized the large potential of Folder Actions Setup. Also described is a method to simply temporarily disable the action when you are opening the folder.
First create a new folder called UnixApps in the main (top-level) Library folder. After downloading Imagesnap, place the Imagesnap application in the new folder (resultant path: /Library/UnixApps/imagesnap). It could easily be saved elsewhere, but that would require some small changes to the AppleScript.