Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Take a picture with the iSight camera when a folder is opened' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Take a picture with the iSight camera when a folder is opened
Authored by: mael on Jan 23, '10 03:46:58PM
Thank you! That *is* a useful script. Since I like my pictures in the corresponding folder, don't need a log (as I will use them from the Terminal) and want them sortable by date, if changed the script slightly. Thanks again! FWIW:

on opening folder this_folder
	
	set filename to "/$(date \"+%Y-%m-%d_%H:%M\").jpg"
	set snapshots_folder to "__Gotcha" --  change this name to your liking
	set pictures_folder to (path to the pictures folder)
	
	--  check if pictures folder exists, and create, if not
	tell application "Finder"
		if not (exists folder snapshots_folder of pictures_folder) then
			make new folder at alias (pictures_folder as text) with properties {name:snapshots_folder}
		end if
	end tell
	
	--  take picture and save it
	--  the binary imagesnap must be installed in /usr/local/bin (or the path below must be adapted)
	do shell script "/usr/local/bin/imagesnap " & (POSIX path of pictures_folder & snapshots_folder & filename)
	do shell script "chflags hidden " & (POSIX path of pictures_folder & snapshots_folder & filename)
	
end opening folder


[ Reply to This | # ]