Taking timed screenshots in OS X #

Looking for a simple way to take screenshots at a set interval, I happened upon this solution which relies on cron. Unfortunately, cron cannot schedule jobs in increments of less than one minute, and I wanted to take screenshots every 3 seconds. Adding delay and repeat to the same script did the trick (note that the save directory has also been changed to the current user's Pictures folder):

repeat
	set DATE_TIME to do shell script "date +%Y_%m_%d_%H%M%S"
	set fname to DATE_TIME & ".png"
	do shell script "/usr/sbin/screencapture -x ~/Pictures/" & fname
	delay 3
end repeat

UPDATE: Just found an open source REALbasic app called Timed Screenshot (2.5MB) that apparently does essentially the same thing. Haven't tried it yet since the AppleScript solution worked beautifully.

/mac | May 01, 2009


Subscribe or visit the archives.