How do I make a custom context menu item in Finder? I do a lot of command line work, which involves a lot of folder navigation with cd.

To make my life easier, I'd love to be able to right-click on a folder in Finder and have a context menu item I could click that simply opens Terminal and cds to that directory.

How would I go about this in OS X (Snow Leopard)? I'm a website developer, so familiar with programming languages and computer literate, so feel free to get technical with me.
If you want the cd command in a new window or tab, you can simply turn on the built-in services, "New Terminal at Folder" and "New Terminal Tab at Folder", by going to System Preferences &gt; Keyboard &gt; Keyboard Shortcuts &gt; Services &gt; Files and Folders.

If you want the cd command in the active window or tab, you can make a simple Automator Service. 


In a new Automator Service, change "Service receives selected" to folders.
Add a "Run AppleScript" action.
Replace (* Your script goes here *) with the following:

tell application "Terminal"
    reopen
    activate
    set cmd to "cd " &amp; quoted form of posix path of input
    try
        if busy of selected tab of window 1 then error
        do script with command cmd in window 1
    on error
        do script with command cmd
    end try
end tell

Save the service with whatever name you want your menu item to have, then it's ready to go.


An alternative to using a contextual menu is to just type cd (with a trailing space) then drag the folder to the Terminal window.