Jump to content

wait until button is active


Djad33
 Share

Recommended Posts

Hello,

I know this subject has a few topics, but I can't find any answer to my problem.

I'm using autoit to automate a PC SOFT program install but there is one moment when the windows stays the same, but the program is installing and the "Terminer" button is grayed and unclickable.

I want for the script to wait until the button is clickable then click it.

Here's my code so far, can you tell me where I'm wrong :

; Define members
Local $clicked = 0
Local $buttonName = "&Terminer"
Local $timeout = 3

; Wait three seconds for the button activation test
For $i = 1 To $timeout Step 1
      ; test if button is active
      If ControlCommand("PC SOFT", "Terminer", "[CLASS:Button; INSTANCE:1]", "IsEnabled", "") <> 0 Then
         ; Click button and end loop
         $clicked = ControlClick("PC SOFT", "&Terminer", "[CLASS:Button; INSTANCE:1]")
        ;If $clicked = 1 Then
            ExitLoop
         EndIf
      EndIf
      Sleep(100)
Next

Link to comment
Share on other sites

1 hour ago, Djad33 said:

I'm using autoit to automate a PC SOFT program install but there is one moment when the windows stays the same, but the program is installing and the "Terminer" button is grayed and unclickable.

Have you checked, if the Installer of the PC Soft program offers the option to run via command line parameters, e.g. silent or unattended ?

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...