MacOS终端设置Skript

时间:2015-10-09 08:36:06

标签: macos terminal automation

有没有办法自动设置MacOS终端窗口?

它应该打开几个标签,重命名其中一些,转换到文件夹,启动其他脚本(例如mongod)等。

1 个答案:

答案 0 :(得分:2)

喜欢这样:

#!/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

enter image description here