Mac Finder and Terminal: Open a Mac Terminal window in the current Finder folder

Mac Terminal Finder tip: How to open a Mac Terminal window in the current Mac Finder folder.

As a Mac OS X newbie, I don't know if there is a better way to do this, but to open a Mac Terminal window from the current Mac Finder folder, I wrote an AppleScript script. I'm new to AppleScript also, so the script is pretty simple. Here's the code:

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 on the Mac menubar, it opens a Mac Terminal window, and automatically places me in the same directory as the current Mac Finder folder. Sweet.

Post new comment

The content of this field is kept private and will not be shown publicly.