Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Command-drag to Terminal to change directory ' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Command-drag to Terminal to change directory
Authored by: aaronrp on Jul 30, '12 10:44:13AM
I have done the following in Snow Leopard: In my .tcshrc:

alias cdf 'cd "`finder-window-dir`"'
Where the file "finder-window-dir" contains:

tell application "Finder"
		POSIX path of (target of window 1 as alias)
	on error
		POSIX path of (path to desktop folder as alias)
	end try
end tell
This lets me type "cdf" and it will cd to the folder that is the topmost open window in the Finder. (Then I put "cdf" in the "Run command" setting under "Shell" in, so it opens with that folder whenever I open a new Terminal window)

[ Reply to This | # ]