AHK won't recognize Chrome Page Elements?
Posted: 12 Jun 2019, 09:20
Objective: Create a shortcut to find and click on a button on the page, then focus cursor on the text field that appears.
The Button:
What happens when I click on the Button:
Chrome Console view when I right click on the button and Inspect Element; and underneath that after I manually click on the Button, then right click the text field and Inspect Element:
What I tried:
This was based on this thread that I found.
The shortcut is not finding/clicking the button. I also tried getElementsByName, and removing "wb" from the beginning of the line (because I noticed that in the dev console) but no luck. It's not finding the button. After a while, I gave up on trying to find the button and did this:
Because the button maintains its position in relation to my screen, despite scrolling through the page up and down. But it's unable to find the text-field either.
Can anyone tell me where I'm going wrong, why it's going wrong, and how to fix it?
[Mod edit: Link fixed]
The Button:
What happens when I click on the Button:
Chrome Console view when I right click on the button and Inspect Element; and underneath that after I manually click on the Button, then right click the text field and Inspect Element:
What I tried:
Code: Select all
!q::
wb.document.getElementById("anId").click()
sleep 1000
wb.document.getElementById("newNote").focus()
return
The shortcut is not finding/clicking the button. I also tried getElementsByName, and removing "wb" from the beginning of the line (because I noticed that in the dev console) but no luck. It's not finding the button. After a while, I gave up on trying to find the button and did this:
Code: Select all
!q::
Click 99 323
Sleep 1000
wb.document.getElementById("newNote").focus()
return
Can anyone tell me where I'm going wrong, why it's going wrong, and how to fix it?
[Mod edit: Link fixed]