Open Terminal to currently open Finder window using AppleScript

There are a lot of different utilities that you can find (and buy) that does the simple task of opening your Terminal to the currently open Finder location. One problem with these solutions is they tend to break when OSX has an update. I finally got tired of having to keep getting a new one to make it work, and worse having to pay for something thats simple to do in AppleScript. Copy this text into your AppleScript Editor and save it as a run only application called finder2term.

?View Code APPLESCRIPT
tell application Finder
	activate
	set this_folder to (the target of the front window) as alias
	set my_path to POSIX path of this_folder
	tell application Terminal
		activate
		do shell script "cd my_path"
	end tell
end tell

Place this application in your /Applications/Utilities. I copied the icon from the Terminal.app Select Terminal in that utilities folder and tap -i to get info, click on the icon in the upper left corner of the get info dialogue and hit to copy it. Close that window and then select the finder2term app in that utilities folder and tap -i to get info, click on the icon in the upper left corner of the get info dialogue and hit to paste the icon in place. Close that window. Now drag finder2term from the window. Now when you have a finder window open you can click this icon and have a new terminal window opened to that directory. I have also found that this solution is MUCH faster than the apps that do the same thing. Enjoy!

width=884

Innovative Engineer/Technologist: Innovatative app developer, systems architect, and project manager in a wide variety of technologies. I am particularly interested in learning about and creating new technology by looking at the 30,000 foot view to see how things can fit together in new and exciting ways. I started my career working at Internet Service Providers and moved into VoIP and Unified Messaging Applications. I currently work in the Switch Networking field. I am constantly looking at new technologies to enhance my own vision of technology as a whole. I consider myself to be of a new generation of Engineers that are able to use and understand technologies while still able to communicate and work with non-technical people.

Posted in Technology Tagged with: , ,