我正在尝试创建一个脚本,该脚本将打开一个iTerm2窗口,将其垂直分成 3 个窗格,并在每个窗格中运行一些命令。
这是我迄今为止的尝试:
\n\ntell application "iTerm2"\n activate\n\n -- Create main window\n create window with default profile\n\n tell current session of current window\n set name to "frontend"\n write text "cd ~/Documents/frontendDir"\n split vertically with default profile\n end tell\n\n tell second session of current window -- ERROR HERE\n set name to "backend"\n write text "cd ~/Documents/backendDir"\n split vertically with default profile\n end tell\n\n tell third session of current window\n set name to "apollo-server"\n write text "cd ~/Documents/GitHub/apolloDir"\n …Run Code Online (Sandbox Code Playgroud)