Skip to content

Instantly share code, notes, and snippets.

@Nappp
Last active April 15, 2019 14:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nappp/2f921bf6eee9410655b89dd668d33daf to your computer and use it in GitHub Desktop.
Save Nappp/2f921bf6eee9410655b89dd668d33daf to your computer and use it in GitHub Desktop.
tell application "iTerm"
set isRunning to (application "iTerm" is running)
activate
tell current window
if (count of tabs) < 1 then
create window with default profile
set isRunning to false
end if
if isRunning then
set newTab to (create tab with default profile)
tell newTab
select
end tell
end if
tell current session
write text "cd /which/ever/path/you/want"
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment