iTerm automation with AppleScript and Bash
AppleScript is a nice way to automate some features of iTerm. Combining that with my Bash scripts was a no-brainer in order to get my default iTerm tabs. You can see all of the code at https://github.com/jacaetevha/finna-be-octo-hipster/
Here's a sneak preview:
** ~/Library/Scripts/itermcreatedefault_tabs.scpt **
tell application "iTerm"
activate
tell the current terminal
set theRailsDir to choose folder with prompt "Select your Rails directory"
repeat 6 times
activate current session
launch session "Default Session"
tell the last session
write text "cd " & (theRailsDir as string)
end tell
end repeat
tell the last session
write text "osascript '~/Library/Scripts/iterm_set_rails_tabs.scpt'"
end tell
end tell
end tell
Written by Jason Rogers
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Applescript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#