
You can go back to the page and right-click the button, then hit InspectĠ6:13 Test the new js path. So best to learnĠ5:54 The button is right next to the input. When using Chrome, you’re going to have to learn JavaScript.Ġ4:56 When using Chrome.ahk, we’re injecting JavaScript. value to set some text in that box.Ġ3:00 page.Evaluate(“document.querySelector(‘#keywords’).value =’Chrome.ahk'”)Ġ4:01 Make sure inside the JavaScript you use the “=”, not “:=”Ġ4:15 Some people don’t want to have to learn JavaScript.

Which will give you queryselector(“#keywords”)Ġ2:26 Use the. This opends Devtools with that element selected.Ġ1:46 It has an ID of “keywords”, copy js path.

Notes for Automating Chrome to Set Text & Click a buttonĠ0:44 Connect to tab using Chrome.GetPageByTitle(“AutoHotkey Community”) the default matchtype is “starts with”Ġ1:23 Look at page structure using right-click and Inspect. Page.Evaluate("document.querySelector('#search > fieldset > button').value ='Chrome.ahk'") Page.Evaluate("document.querySelector('#keywords').value ='" var "'") Variable =document.querySelector('#keywords').value ='Chrome.ahk' Page.Evaluate("document.querySelector('#keywords').value ='Chrome.ahk'") MsgBox % "That wasn' t object / the page wasn't found" Page:=Chrome.GetPageByTitle("AutoHotkey Community","contains") This will connect to the second index of a specific tab

#Include Remember to put Chrome in your library folder If you’re loving this, please consider donating to GeekDude! AutoHotkey script for Automating Chrome to Set Text & Click a button Automating Chrome to Set Text & Click a button In the fourth session with GeekDude we look at out to automate setting text in a search field and then hitting the button to submit the search. The ultimate list of AutoHotkey Resources.AHKCon / First ever AutoHotkey Conference.
