Skip to content

Instantly share code, notes, and snippets.

@vividtone
Created October 10, 2011 01:31
Show Gist options
  • Save vividtone/1274455 to your computer and use it in GitHub Desktop.
Save vividtone/1274455 to your computer and use it in GitHub Desktop.
open new iTerm tab and change directory.
#!/usr/bin/osascript
# open new iTerm tab and change directory.
set current_dir to do shell script "pwd"
tell application "iTerm"
tell application "System Events"
tell process "iTerm" to keystroke "t" using command down
end tell
tell the current terminal
tell the last session
write text "cd " & current_dir
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment