applescript中的击键命令无法识别大小写

时间:2017-03-16 14:49:59

标签: applescript keystroke

tell application "iTerm" to activate
delay 0.1
tell application "System Events" to tell process "iTerm"
   keystroke "Lsj!"
end tell

我想知道如何才能以正确的方式输入一些角色。击键命令无法识别案例。

3 个答案:

答案 0 :(得分:1)

这应该有效

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

答案 1 :(得分:1)

wch1zpink的答案应该有效。

如果需要,您也可以单独写出字母

    keystroke "l" using {shift down} -- uppercase
    keystroke "sj!" -- lowercase

答案 2 :(得分:0)

那应该有用

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