An AppleScript to create timed screen captures

Jan 15, '03 11:00:27AM

Contributed by: ClarkGoble

Someone on the MacNN Forums asked about doing timed repetitive screen captures. To set up a script that takes a screenshot of your desktop every hour, use the following Applescript. Note that "¬" is Apple's line continuation character; type it by hitting option-enter on your keyboard. Here's the script:

set save_location to  ¬
(choose folder with prompt "Choose where to save screenshots")

repeat with shotcount from 1 to 100
do shell script "screencapture " & ¬
quoted form of POSIX path of save_location ¬
& "screen" & (shotcount as string) & ".pdf"
delay (60 * 60) -- delay one hour
end repeat
Note that you can change the loop to whatever you want. You can even make it indefinite and specify a time to quit if you want. Read up on Applescript as there are lots of cool things like this you can do.

[Editor's note: You'll have to save the script as a compiled application and then launch it, of course, in order for this to work. And as an aside, if you do something stupid, like setting the interval to "60 * .016667," (one second) you may find that you have to force quit the script to get it to stop ... don't ask how I know this!]

Comments (14)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030115080027106