Created
October 7, 2009 18:48
-
-
Save sandrods/204309 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on run {input, parameters} | |
| tell application "Terminal" | |
| activate | |
| set p to (quoted form of POSIX path of (input as string)) | |
| set s to "if [ -d " & p & " ]; then cd " & p & "; else cd `dirname " & p & "`; fi" | |
| if (the (count of the window) = 0) or (the busy of window 1 = true) then | |
| do script s | |
| else | |
| do script s in window 1 | |
| end if | |
| end tell | |
| return input | |
| end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment