Page 1 of 1

Wait for accessibilityId

Posted: 28 Aug 2020, 05:17
by obeliksz
Hello Guys!

I have an automation that is unreliable because its dependant on time delays rather than waiting for a UI element to appear or disappear.
I find that this has to be doable in ahk, but inner window component seem to be not as first class citizens as handling just the window as with WinWait or similar.
We can use Window Inspector to get the ui's ids/name but its not clear for me how to use them inside ahk... maybe the fact that ahk can be used to create GUI and instructions on manipulating those are interfering somewhat with this subject.

For example I want to connect to a VPN that requires terms&conditions acceptance before establishing the connection, this involves a lot of clicks that is madness if you have to connect/disconnect many times during the day.
vpn-connection-madness.gif
vpn-connection-madness.gif (152.9 KiB) Viewed 923 times
My script can not be reliable without big timeouts but that would defeat the purpose of scripting it.

So I wish at least for a tutorial on using ahk with accessability id/names, and making using them just as easy as waiting for a window to appear or disappear.

Incorporating such calls would really improve AHK... or making these more visible.
There are also the brute OCR screen readers which could be incorporated for similar use, here is an example for that: https://www.autohotkey.com/boards/viewtopic.php?f=6&t=17834&sid=b942373bc8cc2801e5f02e733d3917a1

Thanks!

Re: Wait for accessibilityId

Posted: 02 Sep 2020, 18:51
by gwarble
i don't have an answer for your question, but maybe solve your problem a different way

i think there is a wmic way and a powershell way, but i think this is still supported:

Code: Select all

Run, rasdial vpnname
sleep, 30000
Run, rasdial vpnname /disconnect

Re: Wait for accessibilityId

Posted: 06 Sep 2020, 19:41
by malcev
So I wish at least for a tutorial on using ahk with accessability id/names, and making using them just as easy as waiting for a window to appear or disappear.
Search Acc_SetWinEventHook.