I'm trying to click on a Chrome extension ( Google Highlight : https://chrome.google.com/webstore/detail/multi-highlight/pfgfgjlejbbpfmcfjhdmikihihddeeji) then click on the text box and past my variables.
here is my code
set NoteforGoogleCHrome to "My text should be there"
tell application "Google Chrome"
activate
end tell
tell application "System Events"
tell process "Google Chrome"
delay 2
click button 8 of toolbar 2 of window "myTab" of application process "Google Chrome" of application "System Events"
delay 0.2
keystroke tab
delay 0.2
keystroke NoteforGoogleCHrome
delay 0.2
keystroke space
end tell
end tell
I tried this but this is most of the time failing.
When I'm trying to click on the text field (CLICK 2) I always have an error :
click process "Google Chrome" at {4000, 114} –> missing value
However if I do the same for CLICK 1 I have no error.
Can you give me some advice ?
Best Answer
The following works for me in macOS High Sierra 10.13.5 and Google Chrome 67.0.3396.99.
Example AppleScript code:
As you can see in the image below, it highlighted all occurrences of
click
andme
.