OS X Tip: Change shell to that of frontmost Finder window
I was looking for any integration between Finder and Git (because I like GUIs sometimes. (I know about GitX.))
I came across this instead, a bash function (which works in zsh) that changes directory to that of the frontmost Finder window. It's convenient!
cdfinder() { cd "$( /usr/bin/osascript <<" EOT" tell application "Finder" try set currFolder to (folder of the front window as alias) on error set currFolder to (path to home folder as alias) end try POSIX path of currFolder end tell EOT )" }
Reference: asktherelic.com/.../osx-terminal-and-finder-integration/
Alternatively, just drag the folder icon from the title part of that Finder window (at the top, to the left of the name of the current folder) into the Terminal window.
As a result, the path to that folder will be pasted into the Terminal window.
A tip for those who have adobe products installed,
running osascript in 32-bit mode helps it from stalling on the script additions adobe makes
arch -i386 osascripts
Nice hack!
I use 'cd to..' for this -
http://code.google.com/p/cdto/
good
