Skip to content

Instantly share code, notes, and snippets.

@natecook1000
Created October 8, 2017 20:39
Show Gist options
  • Select an option

  • Save natecook1000/7ff05fbc6062507b2b34961be39a0ac2 to your computer and use it in GitHub Desktop.

Select an option

Save natecook1000/7ff05fbc6062507b2b34961be39a0ac2 to your computer and use it in GitHub Desktop.
Open new Terminal tab with frontmost Finder window
on run
tell application "Finder" to set myDir to POSIX path of (insertion location as alias)
tell application "Terminal"
activate
if not (exists window 1) then
reopen
else
tell application "System Events" to keystroke "t" using command down
end if
do script "cd " & quoted form of myDir in window 1
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment