Thursday, February 24, 2011

Stop the Desktop invasion of screenshots!

As a QA guy I take sh*t tons of screen shots. OS X has an amazing built in screenshot tool that I happily snap away with. Only prolem is that my desktop would quickly run amok with errant screenshots like such:


Eventually I got frustrated with this and decided to look into a screenshot manager and found nothing very promising so I came up with a quick, dirty, cheap, homebrew solution. Here is how it works:
  1. Create a Screenshots folder wherever you like. I chose: ~/martinek/Screenshots/
  2. Open up Terminal and enter the following command: defaults write com.apple.screencapture location /Full/Path/To/Folder
  3. Then logout of your user acount and back in again. I found the instructions here, if so inclined you can change the format of your screenshots as well to jpeg, but I think png works best.
  4. Take a screenshot to verify that its in the new shiny screenshots folder
  5. Personal preference here, but I think it works really well. Drag the Screenshot folder to the right side of the dock. You can then right click on it and choose your sorting options. This leverages OS X's very cool dock UI and makes it easy to find images based upon sorting criteria. 
  6. Next to avoid the excessive screenshot issue create a new folder in the screenshot folder called Archive, or what ever you want really.
  7. Next open Automator, yes really Automator. Start with a new folder action.
  8. Unfortunately Automator has a bug with it trying to detect files that are a day old, so we will use the terminal command option to handle the sorting. Add the Run Shell Script action to the canvas and enter the following command: find /Users/path_to/your/screenshot_folder/* -name "*.png" -type f -mtime +1
    This command looks for all files in the Screenshots folder with the .png extension that are older than one day.
  9. Then add the Move Finder Items action to the canvas and choose your Archive filer as the destination
  10. Next right click on the first action Run Shell Script and add Archive to the file path and change the -mtime to "-mtime +7". This looks for files older than 7 days.
  11. Next add the Move Finder Items to the Trash. I decided that a screenshot older than about a week was worthless.
The result should look like this:
Saving the workflow should automatically save the actions to the respective folders. You can always right click on the folders to disable the workflow. Hope this helps keep some desktops out there a bit tidier.


    Saturday, February 19, 2011

    Blogs: Who cares?

    I decided to start a blog again. This time I am bit older, have a bit more experience about the things I write about and what to write about. From the last blog I had I learned that the most read and useful posts were usually tutorials and how to do things.  I will try to keep in that tradition and give insight about things I have learned the hard way so incase anyone decides to search for it they might find what small grain of truth I have come across. 

    Why Dumb Robot? To answer that I should start with my last blog keynesiandreamer.com, the blog was named after the school of thought I had while I was in DC finishing my econ degree. A lot has changed since then. Currently, I live in San Francisco, work as the QA manager at an ad agency, and getting ready to race motorcycles for a season and hack away on startup ideas as I get them or when I have time. 

    Last year when I ran Bay to Breakers I decided to do something a bit crazy and went running as the Silver Surfer. It was awesome people were cheering me on "Silver Surfer!", "Silver Guy!" and then one guy yelled "Dumb Robot!". That to me and my friends was about as funny as it got! So the name has stuck. 

    Hope you may find something of value here.

    -Ben

    Justice League!

    Silver Surfer