Automate Your Screen Grabs
I find that I’m often taking screenshots and posting them online. I’ll need to collaborate with a client about a user interface choice, or I’ll see something funny that I want to post in my blog. Mac OS X provides some nice screen capture keyboard short cuts. But capturing the image is the easy part.
Once I’ve got the image file, I have to decide what server to put it on and then figure out how to get it there. If I want to upload to Flickr, I’ll switch over to Firefox and upload from there. Or if I want to copy it to a personal web server, I have to fire up Terminal.app, (or more likely switch to Terminal.app because it’s usually running) cd to the Desktop and the scp the file up to some server or another. All of this seemed not very efficient.
First of all, I should keep stupid little screen grabs out of Flickr. Luckily, I have a slicehost account I can use to host images like this. I just want to make it brainless to get the images on the server and have the URL handy when I need it.
Enter Automator. Here’s a little app that takes a screen shot, names the file with the date and time, uses scp to copy it to my image server, opens my preferred browser to the URL of the newly uploaded image, and fills my clipboard with the URL. Here’s how you can do it too (peppered with gratuitous use of the app itself).
Fire up Automator and create a new workflow. Start with the Take Screenshot action.

I’ve named my screen capture screengrab.png. Name yours whatever you like. Just remember where you put it. Mine goes in /Users/lanceball/Pictures/ScreenGrabs/Pending.
Now pull in 2 Rename Finder Items actions and add Date and Time to the file name.


This will rename the file to something like screengrab-2009-1-4-16-11-15.png. Now we get to do an itty bit of custom coding using the Run Shell Script Action.

This copies the image file to the remote server, moves the file to “Sent” directory, opens it in my browser, and then echoes the URL so that the next action, Copy to Clipboard does just that - copies the URL to the clipboard.

Test it a few times to see if it works for you. If it does what you want, save it as an Application. I called mine GrabAndGo.app, and I use QuickSilver for quick keyboard access to things.

Now, I just fire up QS, type Grab, and select the area of the screen with the mouse. Five keystrokes (and that’s if you count g-r-a-b for QuickSilver), and I’ve got a screen capture uploaded to an image server with my browser open to the image and the URL in my clipboard. Cool.