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:
Set a Folder to Save Screen Shots on Mac
Take Screen Shots on Mac with Keyboard Short Keys
Take ScreenShot Via Terminal On Mac

Set Timer To Take Screenshot On Mac Via Terminal

  1. Go to Finder
  2. Navigate to Applications > Utilities and launch Terminal
  3. 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; donewhere:
    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 the 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
    i = variable which is used to give the names to screenshots
    jpg = the format of screenshots
    Desktop/TrickyWays is the folder to save the screenshot
    sleep = time interval between screenshots
    done = ends the while loop

    Press Ctrl+C to stop this loop
14 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


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?


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..:(

Christian Engvall August 22, 2016, 9:59 pm

Thanks for sharing this terminal snippet!
I made a menu bar application that adds a GUI to it

Hilary Tsai April 15, 2021, 3:43 am

this is old but… when I tried the command, it only takes pictures of my desktop background image–no matter what I’m doing.

Pierre Letourneau March 3, 2022, 8:57 pm

I have 2 screen on my Mac, is it possible to choose the second screen to copy? Thank you.

Leave a Comment

Join Our Subscribers

Receive the latest how-to guides, news, and updates from our team.

You have Successfully Subscribed!