小编And*_*dge的帖子

AppleScript为什么总是用Command命令发送击键?

我看到很多AppleScript的例子都是这样的

tell application "TextEdit"
    activate
    tell application "System Events"
        keystroke "s"
    end tell
end tell
Run Code Online (Sandbox Code Playgroud)

预期的结果是字母"s"将被输入到TextEdit中的活动文档中(假设至少有一个文档窗口).但它总是试图保存文档(为更改的文档做了它,如果它是新的则打开保存对话框).任何时候任何应用程序中的任何键都会发生同样的事情......

有没有人知道为什么系统事件总是发送"...使用{command down}"这样的击键?

applescript

4
推荐指数
1
解决办法
6790
查看次数

标签 统计

applescript ×1