Automatic timed screen grab in OS X Tiger !


May 14, 2004
Reaction score
If you need to capture the Screen on your Mac here is one way of doing it...

First, create a folder on your Desktop called captures.

Next we are going to write a shell script...

Open TextEdit and type:


screencapture -x /Users/[B]computer[/B]/Desktop/captures/`date +%b%d%H:%M:%S`.png
Changing the word 'computer' to your username !

Whats all that code then !!!

Well the first bit tells the Mac what Shell to run the code in. In Tiger the default is 'bash'

The next line...

screencapture -x
Capture the whole screen without making the camera click sound !

Leave off the -x if you want to hear the camera !

Next bit...

This is the 'path' where the screencaptures will be saved, on this Mac my username is 'computer' so the screengrabs will be saved in a folder called 'captures' on my desktop.

You will have to amend this to your own folder, maybe

All the files would then go on your Desktop. (remember there will be 20 every hour, so it'll get cluttered !)

The next bit...

`date +%b%d%H:%M:%S`
This is the unix command 'date' this gets the current date...


ie June the 28th 16.30 and 23 seconds.

The next bit...

The default for Screencapture's via the Terminal is to output a .png file

If you don't have this tagged onto the end of the filename, the files aren't double clickable.

So we now have our Shell Script, do a save as

Don't allow TextEdit to add .txt to the end of the name !

Now we need to open Terminal (Applications-->Utilities)

Once Terminal is open then type

chmod +x
type a space after the x

Don't press return yet...

Find the file and drag it into the terminal so that you get a line similar to this...

chmod +x /Users/computer/Desktop/

Now you can press the return key !

This line turns into an executable file, ie it's now like a little application that the shell can 'run'.

Now move the file somewhere safe, maybe in the Applications folder if you want.

Now download Launchd editor from here.

This is not technically needed but it makes life easier ! Please pay the Developer if you use the App a lot !

Now have a look in this folder,

Is there a folder called 'LaunchAgents' if there isn't then create one.

Now open up Launchd editor.

We are now going to create the 'Screenie plist file'

Just edit as the screen grabs below...

Changing your path info as neccesary !

On my Mac I have left the file on the Desktop !

In the second pic above the 300 seconds will mean that the Shell Script will run every 5 minutes ! Change to suit your needs !

Now save that file as screenie.plist in the 'LaunchAgents' folder that you created above.

Now back to Terminal and type...

launchctl load /Users/computer/Library/LaunchAgents/screenie.plist
Again changing the path as necessary !

Now, best to reboot ! You are done !

Every 5 minutes a new screen grab is taken and saved to where you specified...

You can always extend this to then email the Screen Grab...FTP it somewhere what ever you want !

To turn it of...

launchctl unload /Users/computer/Library/LaunchAgents/screenie.plist
Again replace the path as neccesary !

You should end up with something like this...




Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question