To capture a screenshot on a OS X machine you use the keyboard or a terminal command.
Using the keyboard just enter the following key combination.
Full screenshot COMMAND + SHIFT + 3
Custom area screenshot: COMMAND + SHIFT + 4
From the terminal enter the following command
If you script this or run the command twice you need to choose a unique name for each time you run the command. You can use a command like this to generate a unique name for every screenshot.