Wednesday, 6 July 2011

A script to automatically open a Terminal window to its directory

How many times have you been to a folder in Finder and needed a Terminal window open to that folder? For me, the answer was many. So, I wrote little AppleScript to take care of it automatically.


This script works by opening a Terminal window and cd'ing into the directory the script was in. Just copy the script into every folder you want to use if from; it's got a tiny footprint. Here's the code:
 set myPath to (do shell script "dirname " & quoted form of (POSIX path of (path to me) as string)) as string tell application "Terminal"   activate   do script ("cd " & quoted form of myPath) end tell 
Paste this into AppleScript Editor and save it as an application. Copy it into each folder you'll want to use it with.

I recommend naming it something like " Terminal" (the space in f ...

Add to digg Add to Reddit Add to Slashdot Email this Article Add to StumbleUpon

Source: http://feeds.macosxhints.com/click.phdo?i=8044ef3233290da78c7a4212291463f7

mac technical support recent apple news remote desktop apple computer news

No comments:

Post a Comment