I’m a ruby developer, and every morning when I arrive at work I find there is a whole lot to do before I can actually begin coding. Here’s my list of morning chores:
- Delete yesterday’s log files
- Open several terminals
- Update my code form the subversion repository
- Start autotest, memcached, mongrel, and various other servers
- Open my project in my editor
This can become very tedious when you have to repeat it every day, but thankfully it can be simplified into a 1-click process with Apple’s Automator. First things first, I need to delete my old logs. To do that I use the Get Specified Finder Items action and pass it to the Move Finder Items to Trash action:
Next I need to update my working copy from the main repository. You might even have a couple projects that need updating. Again I use Get Specified Finder Items, but this time I pass it to a Run Shell Script action where I use subversion to update each of them:
At this point I’d like to open up Terminal.app, create a few tabs, and start my servers. Before we can use an Automator action, we need to grab a copy of terminit from ELC Technologies. Terminit is a cool little ruby script that lets us initialize Terminal.app tabs and commands to run in each tab. This is my terminit config file:
# Initialize Terminal - tab1: - cd ~/Projects/rails/gigparkapp - memcached & - script/server - tab2: - cd ~/Projects/rails/gigparkapp - rake facebook:tunnel:start - tab3: - cd ~/Projects/rails/gigparkapp - autotest - tab4: - cd ~/Projects/rails/gigparkapp
To execute our terminit config we need to use the Run Shell Script action again:
Finally I need to open up my Textmate project so I can begin coding. I grab the Texmate project file with the Get Specified Finder Items action then pass it to the Open Finder Items action:
Of course you can always throw in a few actions to spice things up a bit:
Or:
All you have to do now is save your worlflow as an application and you’re done. I put my new application right in my dock so I can always access it quickly.















May 12th, 2008 at 1:52 am
Gianni, you have 4 months to figure out how to make this fetch me my coffee in the morning.
May 13th, 2008 at 3:06 am
Nice example on how you can make your life easier with Automator, its a handy little tool indeed.. Cheers Gf.
May 13th, 2008 at 3:15 pm
Automating the Development Environment…
[…]A simple guide that teaches you how to automate your development environment to a 1-click affair using the latest Mac OS X technologies.[…]…
May 14th, 2008 at 7:39 am
Hmm, nice. I replicate same functionality, albeit with a bash script, most of the time.
May 22nd, 2008 at 9:30 am
This is fantastic, but when I use this, my Terminal windows open up skinny (or, more likely, normal). Any way to set the width of the windows or to have it obey the Terminal defaults?
May 22nd, 2008 at 2:39 pm
Sean, if you open up the Terminal.app preferences, select the Settings tab, then the Window pane you’ll see an area where you can adjust the number of columns and rows of the terminal. You’ll want to modify those settings, I keep mine at 244 cols and 64 rows for a 1680×1050 resolution.
Here is a screenshot of the settings.
Now your Terminal.app will always start at that size.
June 9th, 2008 at 4:34 pm
Doh, I thought I had set those already, but it turns out I had just had a set of windows that I’d manually resized open for weeks and hadn’t closed them.
Thanks.