【发布时间】:2016-07-18 19:58:16
【问题描述】:
我希望能够在命令提示符下输入 it2 myMachine 并弹出一个新会话,其中包含 Iterm2 中该配置文件的默认值。
以下内容在升级之前一直有效,其中 $1 是配置文件名称...
osascript <<ENDSCRIPT
on run argv
tell application "iTerm"
activate
tell the first terminal
launch session "$1"
end tell
end tell
end run
ENDSCRIPT
71:79:语法错误:应为类名,但找到了标识符。 (-2741)
我也在看 bash 中的直接 osascript。但是新标签没有得到命令。
osascript -e "tell application \"Terminal\""
-e "tell application \"System Events\" to keystroke \"t\" using {command down}"
-e "do script \"cd $pwd; clear\" in front window"
-e "end tell"
【问题讨论】:
-
我在 iterm2 帮助页面上找到了所有... tell application "iTerm2" tell current window create tab with default profile end tell end tell 有许多标准的 Applescript 函数(例如,获取窗口的大小和位置),此处未记录。使用默认配置文件创建选项卡 使用配置文件“名称”创建选项卡
标签: macos applescript iterm