【问题标题】:The keystroke command in applescript can't identify caseapplescript中的击键命令无法识别大小写
【发布时间】: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


【解决方案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

【讨论】:

    【解决方案2】:

    wch1zpink 的回答应该有效。

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

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

    【讨论】:

      【解决方案3】:

      应该可以的

      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
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-06-15
        • 2020-09-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多