Created
June 10, 2016 02:18
-
-
Save arkki/b89bdf8ebf5c7ecdcc08a1669ae9098c to your computer and use it in GitHub Desktop.
Iterm2 (build 3.0.0) launch new tab with Applescript to given dir
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
| on run dir | |
| tell application "iTerm" | |
| activate | |
| if (count of windows) = 0 then | |
| set theWindow to (create window with default profile) | |
| set theSession to current session of theWindow | |
| else | |
| set theWindow to current window | |
| tell current window | |
| set theTab to create tab with default profile | |
| set theSession to current session of theTab | |
| end tell | |
| end if | |
| tell theSession | |
| write text "cd " & dir | |
| end tell | |
| end tell | |
| end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment