OSX script to launch quick access to Google Chrome Voice Search

In the Google Chrome browser (on Mac), you can activate Google Voice Search by pressing Command + Shift + Period from htttp: //google.com.

Assuming the http://google.com URL is loaded on the chrome tab with the search box in focus, should the following applescript not work?

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

For some reason this will not work, and I do not understand why, since the following script will fill the search field with text, as expected:

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

How can I initiate google voice search using script?

+4
source share
1 answer

Try:

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

All Articles