使用AppleScript设置终端选项卡名称

时间:2012-01-16 20:39:37

标签: macos terminal applescript

我有以下脚本,它打开终端,连接到远程主机并在那里启动脚本:

tell application "Terminal"
    activate
    do script "ssh me@myserver" 
    delay 10
    do script "sh ./startserver" in front window    
end tell

如何设置此终端选项卡的名称?

2 个答案:

答案 0 :(得分:3)

    @media (max-width:768px) {
       .navbar {
         position: absolute;
       }
    }

答案 1 :(得分:2)

tell application "Terminal"
    activate
    do script "ssh me@myserver" 
    delay 10
    do script "sh ./startserver" in front window 
    set input to "\"\\033]0;<your title here>\\007\""
    do script "echo -n -e " & input   
end tell

<your title here>替换为您希望标题的文字。