Skip to content

Instantly share code, notes, and snippets.

@datMaffin
Last active January 15, 2019 14:10
Show Gist options
  • Save datMaffin/b47145c719303e45abcbc1ae31756e41 to your computer and use it in GitHub Desktop.
Save datMaffin/b47145c719303e45abcbc1ae31756e41 to your computer and use it in GitHub Desktop.
AppleScript for opening a single new Terminal.app window at the location `input`
set posix_input to POSIX path of input
if application "Terminal" is running then
tell application "Terminal"
open posix_input
activate
end tell
else
tell application "Terminal"
if not (exists window 1) then reopen
activate
do script "cd \"" & posix_input & "\"" in window 1
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment