Câu trả lời:
AppleScript cho iTerm 2.9 / 3
tell application "iTerm"
activate
tell (create window with profile "nvim")
end tell
end tell
write text dường như không hoạt động, cũng không execute command.
tell current session of current window write text "echo test;" end tell hoạt động như một lá bùa. Lấy từ các nguồn kiểm tra iTerm2 AppleScript. github.com/gnachman/iTerm2/blob/master/source/
Bạn có thể tạo một AppleScript để thực hiện điều này và xuất nó dưới dạng một ứng dụng.
AppleScript [ nguồn ]:
tell application "iTerm"
activate
tell (make new terminal)
launch session "Your Profile Name"
end tell
end tell
Để xuất dưới dạng ứng dụng [ nguồn ]:
Trong trình soạn thảo Applescript File- & gt; Save As và chọn Định dạng tệp làm Ứng dụng.
error "The variable terminal is not defined." number -2753 from "terminal" trong 10.10 Yosemite (iterm2 2.9) LOLOL
tell application "iTerm" activate create new window with profile "nvim" end tell công trình tho