Jump to content
Sign in to follow this  

Is ControlClick 100% sure?

Recommended Posts


I made a script for automating printing of lots of documents, but after some testing I had the feeling that sometime Autoit was waiting for a window closing when ControlClick SHOULD already clicked, clicking manually the script contined with no problem.

Without thinking too much I changed the script that way:

While 1
 ControlClick("classname=#32770", "Nothing to print.", "Button1")
 $ERROR = WinWaitClose("classname=#32770", "Nothing to print.", 5)
 If $ERROR Then ExitLoop
Wend;Creating a loop that check if the window disappear in 5 seconds, if not
        ;reclicking the OK button.

But testing again I saw that the problem may also been in a other window that appear unpredicably and that may have stole the click...

So I wonder. Now that I solved this strange window appearance, can I safely remove this loop that "reclick" if the window do not understood?

Or it may actually happen that the program do not see the click Autoit sent it?


Share this post

Link to post
Share on other sites

This is only guess... but AutoIt doesn't wait for the control to become "clickable" when the control doesn't yet exist. So maybe AutoIt was too fast and tried to execute the click when the window or control did not exist yet?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.