Last active
July 9, 2016 12:01
-
-
Save didenko/cdba4e2f8d524c641b4c89771be710c3 to your computer and use it in GitHub Desktop.
run iTerm2 in a specific folder (AppleScript) Raw
This file contains 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 argv | |
tell application "iTerm" | |
if exists current window then | |
tell current window | |
create tab with default profile | |
end tell | |
else | |
create window with default profile | |
end if | |
tell current session of current tab of current window | |
write text "cd \"" & item 1 of argv & "\"" | |
end tell | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run the script with a directory name parameter, e.g.:
It is a useful example of integration with other UI programs, like an CLion IDE example below calling iTerm2: