Jump to content

Help with application automation


KBcool
 Share

Recommended Posts

Hello,

I have been working with AutoIt for a bit now (though I am the definition of "Beginner") and I have an issue with a script I am making. I have attempted to make a script that will run an aplication automatically. The application in question is a registry cleaner from Auslogics.

Here is the script as such:

opt("SendKeyDelay", 300)
WinWaitActive("Auslogics Registry Cleaner")
    ControlSend("Auslogics Registry Cleaner", "Scan Now", "TAxCheckboxTreeView201", "{DOWN 14}{SPACE}")
        ControlSend("Auslogics Registry Cleaner","Scan Now","TAxDropDownButton201","{DOWN 3}{ENTER}")
    WinWait("Auslogics Registry Cleaner","< Back")
        ControlSend("Auslogics Registry Cleaner","< Back","TButton1","&{SPACE}")
    WinWait("Auslogics Registry Cleaner","Repair",200)
        $Repair = ControlSend("Auslogics Registry Cleaner","Repair","TButton1","&{SPACE}")
            If $Repair == 1 Then
                Opt("SendKeyDelay", 10000)
                Send("!{F4}")
                Else
                    Opt("SendKeyDelay", 5) 
                    Send("!{F4}")
            EndIf

The script was working fine until I got to the section where I create the $Repair variable. What I'm attempting is to make the script pause for 10 seconds if it successfully sends a keypress to the repair Control, to give the program enough time to complete. However if it does not exist it will exit immediately. As it stands it will exit immediatly even if it does find a button labeled "Repair".

Any help would be greatly appreciated.

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...