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


Click here to return to the 'A script to automatically open a Terminal window to its directory' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to automatically open a Terminal window to its directory
Authored by: Mr.C.Tippins on Jun 29, '11 12:00:10AM
Why not use AUtomator to create a Service for Finder so you can just right-click on your folder and select "Open folder in Terminal"?

Do this:

Open Automator
Create a new Service
Drag the Run Applescript action over
Paste in the following Applescript slightly modified from the original poster:
tell application "Finder" to set the myPath 
	to (the target of the front window) as alias
set myPath to POSIX path of myPath

tell application "Terminal"
	activate
	do script ("cd " & quoted form of myPath)
end tell

Save that as something like: Open folder in Terminal
And there ya go......

There is a way to pass your selection from the FInder to your script but I didn't work long enough to figure out how that works.

Enjoy....

[ Reply to This | # ]
A script to automatically open a Terminal window to its directory
Authored by: Mr.C.Tippins on Jun 30, '11 08:52:42PM

You can even use the Keyboard pref pane to assign a key combo for your newly create Context menu item!



[ Reply to This | # ]