【问题标题】:How to open multiple panes on iTerm?如何在 iTerm 上打开多个窗格?
【发布时间】:2016-06-11 16:30:33
【问题描述】:

我创建了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'

【问题讨论】:

    标签: shell terminal applescript iterm panes


    【解决方案1】:

    Applescript 不向后兼容,因为 iTerm2 Version 3

    描述了新的 Applescript 语法here。 你应该替换:

    
    make new terminal
    

    
    create window with default profile
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-07
      • 2015-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多