Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoeGlines/82c1b1d9d8b044a8559cf09167fefc59 to your computer and use it in GitHub Desktop.
Save JoeGlines/82c1b1d9d8b044a8559cf09167fefc59 to your computer and use it in GitHub Desktop.
Handling Event Listeners & Custm edit boxes
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY
; Right now you can get a coupon code here: https://the-Automator.com/Learn
;*******************************************************
#SingleInstance,Force
#Include
;**************************************
page:=Chrome.GetPageByURL("http://www.gethifi.com/tools/regex","startswith") ;This will connect to the second index of a specific tab
If !IsObject(page){
MsgBox % "That wasn' t object / the page wasn't found"
ExitApp
}
document.querySelector("#regex").click()
js=
(
document.querySelector("#regex").value = '.'
document.querySelector("#regex").dispatchEvent(new MouseEvent("mouseup"))
)
js=
(
document.querySelector("#regex").value = '.'
document.querySelector("#regex").dispatchEvent(new KeyboardEvent("keyup"))
)
js=
(
document.querySelector("#regex").value = '.'
document.querySelector("#regex").dispatchEvent(new Event("change"))
)
;~ page.Evaluate(js)
;********************Second page***********************************
page:=Chrome.GetPageByURL("https://regex101.com/","startswith") ;This will connect to the second index of a specific tab
If !IsObject(page){
MsgBox % "That wasn' t object / the page wasn't found"
ExitApp
}
somevar = he"l'lo
escaped:=Chrome.Jxon_Dump(somevar)
MsgBox % escaped
js=
(
document.querySelector('.CodeMirror').CodeMirror.setValue(%escaped%)
)
page.Evaluate(js)
ExitApp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment