Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Script to take screen shots every 30 sec

I am not sure what the commands are but all I want it to do is take a screen shot every 30 sec and save the files with different names in a folder.

Posted on Feb 22, 2008 12:20 PM

Reply
Question marked as Best reply

Posted on Feb 22, 2008 1:23 PM

Launch 'Terminal' and enter ...

man screencapture

... and press the <return> key; or,

screencapture -h

... and press the <return> key.

Once you have decided how to utilize 'screencapture' place ...

do shell script "screencapture ..."

... within your specific AppleScript code - which calls 'screencapture' every n seconds over period y (where 'x' and 'y' are specific to your needs).
6 replies
Question marked as Best reply

Feb 22, 2008 1:23 PM in response to BenChase

Launch 'Terminal' and enter ...

man screencapture

... and press the <return> key; or,

screencapture -h

... and press the <return> key.

Once you have decided how to utilize 'screencapture' place ...

do shell script "screencapture ..."

... within your specific AppleScript code - which calls 'screencapture' every n seconds over period y (where 'x' and 'y' are specific to your needs).

Feb 22, 2008 1:57 PM in response to BenChase

In your code, 'tell application "Finder"' and its 'end tell' are not needed, no file name is provided; and, nor is a file format for '-t' provided.

Code sample -

set dFolder to "~/Desktop/screencapture/"

do shell script ("mkdir -p " & dFolder)

repeat with i from 1 to 900 -- Repeat 900 times.
do shell script ("screencapture -c " & dFolder & (i as string) & ".png") -- Where '-c' copies the screen shot to the clipboard.
delay 30 -- Wait for 30 seconds.
end repeat

Entering ...

mac unix +screencapture

... into a search engine presents many results.

Feb 22, 2008 3:07 PM in response to BenChase

set dFolder to "~/Desktop/screencapture/"

do shell script ("mkdir -p " & dFolder)

repeat 900 times -- Repeat 900 times.
set tTime to do shell script "date +%H%M%S"
do shell script ("screencapture " & dFolder & tTime & ".png") -- Capture screen.
delay 30 -- Wait for 30 seconds.
end repeat

To include the date, as well ...

set dFolder to "~/Desktop/screencapture/"

do shell script ("mkdir -p " & dFolder)

repeat 900 times -- Repeat 900 times.
set dateTime to do shell script "date +%Y%m%d_%H%M%S"
do shell script ("screencapture " & dFolder & dateTime & ".png") -- Capture screen.
delay 30 -- Wait for 30 seconds.
end repeat

Script to take screen shots every 30 sec

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.