AutoHotKey, set focus on a button webpage and send click -


i have 1 button on html page window title "page":

<button onclick="alert('this button has been clicked')">submit</button> 

and using autohotkey, i'm trying set focus on him , send mouse click.

this ahk code write:

^p:: controlfocus, submit, page mouseclick left return 

on pressing ctrl+p keys, should job. unfortunately, doesn't work. i've read documentation examples , can't work...

you can learn lot more intergrating ahk html dom here:
https://autohotkey.com/boards/viewtopic.php?f=7&t=4588
see following example on how can achieved.

example

#singleinstance, off onexit,onexit  gui add, activex, x0 y0 w640 h480 vwb, shell.explorer  ; final parameter name of activex component. wb.silent := true ;surpress js error boxes wb.navigate("http://example.com/") ;put web address here... comobjconnect(wb, wb_events)  ; connect wb's events wb_events class object. gui show, w640 h480  return  guiclose: onexit: exitapp  class wb_events {     ;navigatecomplete2(wb, newurl)     ;downloadcomplete(wb, newurl)     documentcomplete(wb, newurl)     {         if (wb.readystate == 4) { ; see http://stackoverflow.com/a/9835755/883015             sleep, 300 ;wait 300 ms              ;do here...             ;for example, click first link on page, can change button.             wb.document.getelementsbytagname("a")[0].click()             msgbox item clicked.         }         return     } } 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -