【发布时间】:2017-08-07 19:49:53
【问题描述】:
tell application "iTerm" to activate
delay 0.1
tell application "System Events" to tell process "iTerm"
keystroke "Lsj!"
end tell
我想知道如何获得输入某些字符的正确方法。击键命令无法识别大小写。
【问题讨论】:
标签: applescript keystroke
tell application "iTerm" to activate
delay 0.1
tell application "System Events" to tell process "iTerm"
keystroke "Lsj!"
end tell
我想知道如何获得输入某些字符的正确方法。击键命令无法识别大小写。
【问题讨论】:
标签: 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
【讨论】: