Google chrome 用于触发Google Chrome的OSX脚本';s语音搜索键盘快捷键
在Google Chrome浏览器(mac电脑上)中,按Command+Shift+Period from可激活Google语音搜索htttp://google.com. 假设url加载在chrome选项卡中,搜索框处于焦点位置,那么下面的applescript不应该工作吗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
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