【发布时间】:2016-10-24 15:04:57
【问题描述】:
可能是我弄错了一个小的语法问题,但在 ITerm2 documentation 中找不到解决方案。我想创建一个applescript,它打开一个带有三个选项卡的ITerm 窗口,每个选项卡都运行各种shell 命令(ls、cd、echo 等),在这些命令运行后剩余的选项卡保持打开状态。打开的选项卡部分工作正常,但似乎只要命令运行,选项卡就会关闭(如果我不提供任何命令,选项卡将保持打开状态。)对于我的脚本:
tell application "iTerm2"
create window with default profile
tell current window
create tab with default profile command "echo abc"
create tab with default profile
end tell
end tell
我应该放什么而不是“echo abc”,以便 echo 命令将在选项卡中运行,但留给我一个光标让我输入更多命令,而不是随后立即关闭选项卡?
【问题讨论】: