I have a script for auto-installing an app that can't be silently installed. It is about 5 windows long and has a WinWait command with a very specific identifier before every set of ControlClick commands, but sometimes (especially on slower machines) AHK claims it clicked the buttons and is waiting for the next window while the previous window still sits there. The craziest part of this is that the sticking point can be any of the windows. It feels like the chances are weighted toward the first windows, but it has happened (mostly randomly) on all of the windows.
How can this be? Does Windows create a window before the buttons are available and AHK is just too efficient?
I haven't experienced this issue with my (few) other AHK scripts. Could the specific installer be doing something different to confuse an automated install like this?
Is there any way to wait for the buttons to be "active" before they are clicked without a fixed, arbitrary sleep time or some other "trick" that I can employ to get this to work?
Thanks.
AHK clicks window button before it is ready
-
- Posts: 14
- Joined: 22 Nov 2016, 10:20
- Contact:
Re: AHK clicks window button before it is ready
Use WinWaitActive instead of WinWait. If you are still having problems, put a timeout on the WinWaitActive and some kind of error catching fix the problem.
-
- Posts: 14
- Joined: 22 Nov 2016, 10:20
- Contact:
Re: AHK clicks window button before it is ready
WinWaitActive made no difference. I ended up setting a short timeout on WinWait whereupon if the previous window was open it would goto the commands for the previous window again and a While loop for the last window where AHK clicks until the window disappears.
Ugly, but working.
Ugly, but working.
Who is online
Users browsing this forum: Araphen and 424 guests