Created
November 24, 2015 20:40
-
-
Save samjt/40b8fa15c06393a113ec to your computer and use it in GitHub Desktop.
Open Selection in Terminal
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
tell application "Finder" | |
set myFile to selection | |
set myClass to the class of myFile | |
if myClass is not folder then | |
set myFile to container of (myFile as alias) | |
end if | |
end tell | |
set myFile to quoted form of (POSIX path of (myFile as string)) | |
tell application "Terminal" | |
do script "cd " & myFile & "; clear" | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment