How do I open a Terminal window in the same directory as the current Finder folder?

By Alvin J. Alexander, devdaily.com

As a Mac OS/X newbie, I don't know if there is a better way to do this, but to open a Terminal window from a Finder window, what I did is write an AppleScript (script). I'm new to AppleScript also, so the script is pretty simple.

tell application "Finder"
    set myWin to window 1
    set thePath to (quoted form of POSIX path of (target of myWin as alias))
    tell application "Terminal"
        activate
        tell window 1
            do script "cd " & thePath
        end tell
    end tell
end tell

When I run this script from the AppleScript menu (menulet) it opens a Terminal window and automatically places me in the same directory as the current Finder folder.


devdaily logo