Saturday, March 10, 2012

cd to iTerm2

iTerm2 (http://www.iterm2.com/) is the best terminal app that OSX has and is loaded with great features including awesome search, built-in autocomplete, mouseless copy, and the very visually cool Instant Replay.

When I want to open the Finder folder I'm viewing in iTerm, use Quicksilver to launch this app by Stefan van den Oord: http://code.google.com/p/iterm2/wiki/AppleScript#Example_of_"cd_to"_command. This works perfectly except when I have a folder with an exclamation mark in it, so I made a small change to the below code so that it sends a ' instead of a \".

Steps to install from the Google Code page:

  1. Open "AppleScript Editor" (/Applications/Utilities)
  2. In a new document, paste the AppleScript code you'll find below
  3. Save the script to your desktop, name it "cd to", use the file format "Application" (do not select "run only" if you want to be able to change the script later on)
  4. Give the script a nice icon if you want
  5. Drag the script you saved in /Applications/Utilities into the toolbar of any Finder window

No comments: