How to Set Timer to Take Screenshot on Mac Using Terminal

If you want to take screenshots of any movie or application with a specific time interval on Mac OS X then manually it is a little bit difficult task to manage. So, here we are writing a simple method which let you allow to take unlimited screenshots automatically and you may also set time interval between the screenshots according to your requirement.

See also:
How to Set a Folder to Save Screen Shots on Mac
How to Take Screen Shots on Mac with Keyboard Short Keys
How to Take ScreenShot Via Terminal On Mac

How To Set Timer To Take Screenshot On Mac Via Terminal

Step 1

Go to Finder

Navigate to Applications > Utilities and launch Terminal

Step 2

Type the following command in Terminal and hit Enter

while [ 1 ];do vardate=$(date +%d\-%m\-%Y\_%H.%M.%S); screencapture -t jpg -x ~/Desktop/TrickyWays/$vardate.jpg; sleep 10; done

where:
vardate = used to give the names to screenshots which will be the system date & time.
jpg = the format of screenshots.
Desktop/TrickyWays = folder to save screenshot.
sleep = time interval between screenshots.
done = ends the while loop.

Press Ctrl+C to stop this loop

Or use the following command

i=1;while [ 1 ];do screencapture -t jpg -x ~/Desktop/TrickyWays/$i.jpg; let i++;sleep 6; done

where:
i = variable which is used to give the names to screenshots
jpg = the format of screenshots
Desktop/TrickyWays is folder to save screenshot
sleep = time interval between screenshots
done = ends the while loop

Press Ctrl+C to stop this loop

vardate

9 comments… add one

Alex January 9, 2010, 6:13 pm

thanks for mac os x tips

Karla January 11, 2010, 10:06 am

Nice terminal tip to take screenshot on mac

Anirudh December 19, 2012, 4:24 am

How would you make this script work as a cronjob?

Peronaut September 23, 2013, 6:10 pm

Is it possible to apply this command to a specific window on the screen? If yes, how? Thanks for your help!

Henrik October 11, 2013, 5:56 pm

Hey,

This is great. I’m curious if this is possible to edit so you can take screenshots of a very long website/browser window to see how the content changes over a longer time?

Brent November 14, 2013, 10:42 pm

Any way to make this happen with more than one monitor?

cheers

jiwon November 4, 2014, 1:04 pm

in power mac g5, it doesnt work. how to take Automatic screenshot with date &time?
please help :(

TrickyWays November 7, 2014, 2:27 am

Would you please tell me the OS X version installed on your Mac?

jiwon November 7, 2014, 6:22 am

already installed os x 10.5.8 version on my mac. i think it’s the problem of power mac maybe..:(

Leave a Reply