I have one button on my html page with window title "Page":
<button onclick="alert('This button has been clicked')">Submit</button>
and using AutoHotKey, I'm trying to set focus on him and then send a mouse click.
This is the AHK code i write:
^p::
ControlFocus, Submit, Page
MouseClick left
return
On pressing Ctrl+P keys, it should do his job. Unfortunately, it doesn't work. I've read the documentation with some examples and I can't get it to work...
wb.Document.getElementByID("ElementName").click()
(if you know the element name) orwb.document.getElementsByTagName("button")[1].click()
if it can only be accessed by its tag type and index. See also autohotkey.com/board/topic/… – PGilm.click()
to.focus()
. Or, if you need to check the text of the control (like when the button is randomly placed on left or right), you can look at the.innerText
or.innerHTML
but this is all explained in the two tutorials @MCL and I directed you to. – PGilm