KBcool Posted October 17, 2010 Share Posted October 17, 2010 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 More sharing options...
MrPPP Posted October 17, 2010 Share Posted October 17, 2010 Why you do not just use "Sleep ( 10000 ) " to pause the script for 10 seconds? Link to comment Share on other sites More sharing options...
KBcool Posted October 17, 2010 Author Share Posted October 17, 2010 Actually I have done that now, but unfortunately it still closes prematurely even when there is a repair to be made. Link to comment Share on other sites More sharing options...
Bert Posted October 17, 2010 Share Posted October 17, 2010 Does the application support command line switches? If yes, then automating the program is real easy. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now