Created
March 24, 2022 03:53
-
-
Save cweave/1d654415ef95eda3293883ee6298cfb5 to your computer and use it in GitHub Desktop.
Automating iTerm2 with Applescript
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
#!/usr/bin/osascript | |
tell application "iTerm2" | |
# Open window in full screen | |
tell application "System Events" | |
keystroke "f" using {control down, command down} | |
end tell | |
set serverSession to current session of current window | |
tell serverSession | |
set name to "SERVER" | |
# navigate to directory and start service | |
write text "cdkwhub" | |
write text "rs" | |
# split vertically | |
set webpackSession to (split vertically with default profile) | |
end tell | |
tell webpackSession | |
set name to "WEBPACK" | |
# navigate to directory and start service | |
write text "cdkwhub" | |
write text "rw" | |
end tell | |
tell current window | |
create tab with default profile | |
set tab2 to current session | |
end tell | |
tell tab2 | |
set name to "ENGINE" | |
# navigate to directory and start service | |
write text "runkwengine" | |
end tell | |
tell current window | |
create tab with default profile | |
set tab3 to current session | |
end tell | |
tell tab3 | |
set name to "REPORTING" | |
# navigate to directory and start service | |
write text "cdkwreporting" | |
write text "npm run start" | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment