问题
Is there a way to automatically setup a MacOS Terminal Window?
It should open a few tabs, rename some of them, transition to folders, launching other scripts (e.g. mongod) etc.
回答1:
Like this maybe:
#!/bin/bash
osascript<<EOF
tell application "Terminal"
set newTab1 to do script "cd /etc && ls && echo && echo I am in /etc and in Ocean style"
set current settings of newTab1 to settings set "Ocean"
set newTab2 to do script "cd $HOME/Desktop && ls && echo && echo I am on your Desktop and in Man Page style"
set current settings of newTab2 to settings set "Man Page"
end tell
来源:https://stackoverflow.com/questions/33033606/macos-terminal-setup-skript