【问题标题】:Applescript Keystroke "⌘+" gives an errorApplescript 击键“⌘+”给出错误
【发布时间】:2015-10-21 03:54:32
【问题描述】:

我的小程序不工作。我想要在我的 Mac 上执行 ⌘+ 的击键。 这是我当前的代码。

set abc to "+"
tell application "System Events"
keystroke command & abc
keystroke a
end tell

当我点击播放时,我得到了错误

“系统事件出错:无法将 {command, \"n\"} 输入文本。”从 {command, "n"} 到文本的数字 -1700。

有人知道如何解决这个问题吗?

【问题讨论】:

    标签: applescript keystroke


    【解决方案1】:

    按修饰键的语法是

    set abc to "+"
    tell application "System Events"
      keystroke abc using command down
    end tell
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多