0

我创建了 applescripts 的别名以在 iTerm 上打开多个窗格。但是,自从最新更新以来,脚本停止工作。我不断收到此错误:

syntax error: Expected end of line but found identifier. (-2741)

这是脚本:

newPaneDown() {
osascript -e "
tell application \"iTerm\"
  make new terminal
  tell the current terminal
    activate current session
    tell the last session
      tell i term application \"System Events\" to key code 2 using {shift down, command down}
    end tell
  end tell
end tell"
}
newPaneLeft() {
osascript -e "
tell application \"iTerm\"
    make new terminal
    tell the current terminal
        activate current session
        tell the last session
            tell i term application \"System Events\" to key code 2 using command down
        end tell
    end tell
end tell"
}
newPanes4x4() {
/usr/bin/env osascript <<-EOF
tell application "iTerm"
    activate
        launch session "Panes"
        tell i term application "System Events" to keystroke "d" using command down
        tell i term application "System Events" to keystroke "D" using command down
        tell i term application "System Events" to keystroke "[" using command down
        tell i term application "System Events" to keystroke "[" using command down
        tell i term application "System Events" to keystroke "D" using command down
end tell
EOF
}
alias p2='newPaneLeft'
alias p3='newPaneDown && newPaneLeft'
alias p4='newPanes4x4'
4

1 回答 1

0

Applescript is not backwards compatible since iTerm2 Version 3.

The new Applescript syntax is described here. You should replace:


make new terminal

with


create window with default profile
于 2016-07-08T09:33:24.117 回答