tell application "iTerm" to activate
delay 0.1
tell application "System Events" to tell process "iTerm"
keystroke "Lsj!"
end tell
我想知道如何才能正确地输入某些字符。 keystroke命令无法识别大小写。AppleScript中的keystroke命令无法识别案例
tell application "iTerm" to activate
delay 0.1
tell application "System Events" to tell process "iTerm"
keystroke "Lsj!"
end tell
我想知道如何才能正确地输入某些字符。 keystroke命令无法识别大小写。AppleScript中的keystroke命令无法识别案例
这应该工作
set the clipboard to "Lsj!" as text
tell application "iTerm" to activate
delay 0.1
tell application "System Events" to tell process "iTerm"
keystroke (the clipboard)
end tell
wch1zpink的答案应该工作。
您如果需要
keystroke "l" using {shift down} -- uppercase
keystroke "sj!" -- lowercase
也可以单独写出来的文字应工作
tell application "iTerm" to activate
delay 0.1
tell application "System Events" to tell process "iTerm"
key code 37 using {shift down}
key code 1
key code 38
end tell