
I overheard someone at work saying “I wish there was a way to take a screenshot and then automatically add it to an email as an attachment.” so I decided to find a way to make it happen with applescript and terminal.
Terminal has a screen capture command, which should be easy to remember as it is called screencapture. To find more information on this command, type ‘man screencapture’ in terminal to read through the entire manual.
There are two three parts to this command, two of which are essential for the command to run properly.
Part 1 – The command ’screencapture’
Part 2 – Modifiers (optional)
Part 3 – Where you want the file to be placed
Command I used for this script: screencapture -iM ~/capture.jpg
In this example, the modifiers -i and -M tell terminal to allow the user to draw a selection and create a new email with the capture as an attachment. The file is then placed in the in the users root directory.
From here, you can copy the terminal command to Script Editor, add some applescript, and save it as an application. You can add this to your dock to send a screenshot to your mom.
August 31st, 2009 at 12:31 pm
Not bad. I use Skitch for this: http://skitch.com/