Skip to content

Instantly share code, notes, and snippets.

@samjt
Created November 24, 2015 20:40
Show Gist options
  • Save samjt/40b8fa15c06393a113ec to your computer and use it in GitHub Desktop.
Save samjt/40b8fa15c06393a113ec to your computer and use it in GitHub Desktop.
Open Selection in Terminal
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