【问题标题】:OSX script for triggering Google Chrome's Voice Search keyboard shortcut用于触发 Google Chrome 语音搜索键盘快捷键的 OSX 脚本
【发布时间】:2012-11-27 16:54:03
【问题描述】:

在 Google Chrome 浏览器(在 Mac 上)中,您可以通过在 http://google.com 中按 Command+Shift+Period 来激活 Google 语音搜索。

假设 url http://google.com 加载到 chrome 选项卡中,搜索框处于焦点位置,下面的 applescript 不应该工作吗?

tell application "Google Chrome"
    activate
    tell application "System Events" to keystroke "." using {command down, shift down}
end tell

由于某种原因它不起作用,我不明白为什么,因为以下脚本将按预期用文本填充搜索字段:

tell application "Google Chrome"
    activate
    tell application "System Events" to keystroke "this test works as expected"
end tell

如何使用脚本触发谷歌语音搜索?

【问题讨论】:

    标签: google-chrome applescript google-search


    【解决方案1】:

    试试:

    tell application "Google Chrome" to activate
    tell application "System Events"
        key code 47 using {command down, shift down}
    end tell
    delay 3
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-26
      • 1970-01-01
      • 2010-11-29
      • 2011-01-08
      • 2018-10-25
      • 2010-10-04
      • 2015-04-15
      相关资源
      最近更新 更多