获取告诉应用程序"iTerm2"脚本的错误



我试图垂直发射多个iTerm2制表符,我得到一个错误。

下面是我正在运行的脚本:

#/bin/bash
tell application "iTerm2"
tell current session of current tab of current window
write text "ssh host"
repeat 1 times
split vertically with default profile
end repeat
end tell
tell second session of current tab of current window
write text "ssh host"
end tell
end tell

我得到以下错误:

./iterm2.sh: line 3: tell: command not found
./iterm2.sh: line 4: tell: command not found
write: text is not logged in on ssh host
./iterm2.sh: line 6: repeat: command not found
split: vertically: No such file or directory
./iterm2.sh: line 8: end: command not found
./iterm2.sh: line 9: end: command not found
./iterm2.sh: line 10: tell: command not found
write: text is not logged in on ssh host
./iterm2.sh: line 12: end: command not found
./iterm2.sh: line 13: end: command not found

这是一个AppleScript,不是bash。

将she-bang改为:

#!/usr/bin/osascript

相关内容

  • 没有找到相关文章

最新更新