Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome 用于触发Google Chrome的OSX脚本';s语音搜索键盘快捷键_Google Chrome_Applescript_Google Search - Fatal编程技术网

Google chrome 用于触发Google Chrome的OSX脚本';s语音搜索键盘快捷键

Google chrome 用于触发Google Chrome的OSX脚本';s语音搜索键盘快捷键,google-chrome,applescript,google-search,Google Chrome,Applescript,Google Search,在Google Chrome浏览器(mac电脑上)中,按Command+Shift+Period from可激活Google语音搜索htttp://google.com. 假设url加载在chrome选项卡中,搜索框处于焦点位置,那么下面的applescript不应该工作吗 tell application "Google Chrome" activate tell application "System Events" to keystroke "." using {comma

在Google Chrome浏览器(mac电脑上)中,按Command+Shift+Period from可激活Google语音搜索htttp://google.com.

假设url加载在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
如何使用脚本触发谷歌语音搜索?

试试:

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