ardak2000 Posted October 12, 2014 Share Posted October 12, 2014 Hey guys. I've got a script designed to wait for a window to pop up and then press the requisite button to get the window to go away. This should be a very easy task to perform, but for some reason I cannot get this script to loop infinitely. I've tried variations of all of AutoIts Loop commands, but no matter what I try the best I can do is to get it to work just once. What am I doing wrong? Here's the script in it's current iteration. While True $win = WinWait("DFX Message", "OK") ControlClick($win, "", "[CLASS:Button; INSTANCE:1]") WinWaitClose($win) ContinueLoop WEnd Thanks, Ardak Link to comment Share on other sites More sharing options...
alienclone Posted October 12, 2014 Share Posted October 12, 2014 Hey guys. I've got a script designed to wait for a window to pop up and then press the requisite button to get the window to go away. This should be a very easy task to perform, but for some reason I cannot get this script to loop infinitely. I've tried variations of all of AutoIts Loop commands, but no matter what I try the best I can do is to get it to work just once. What am I doing wrong? Here's the script in it's current iteration. While True $win = WinWait("DFX Message", "OK") ControlClick($win, "", "[CLASS:Button; INSTANCE:1]") WinWaitClose($win) ContinueLoop WEnd Thanks, Ardak I like to be aggressive with mine. While 1 sleep(90) winkill("DFX Message", "OK") WEnd If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version Link to comment Share on other sites More sharing options...
Moderators Solution JLogan3o13 Posted October 12, 2014 Moderators Solution Share Posted October 12, 2014 Hi, ardak2000. Try taking the WinWaitClose and the ContinueCase out, and see what that does for you. Also, put in a Debug option at the top of your script so you can see what line the script is hanging on: Opt("TrayIconDebug", 1) alienclone 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
alienclone Posted October 12, 2014 Share Posted October 12, 2014 Hi, ardak2000. Try taking the WinWaitClose and the ContinueCase out, and see what that does for you. Also, put in a Debug option at the top of your script so you can see what line the script is hanging on: Opt("TrayIconDebug", 1) holy cow JLogan3o13, that option is going to save me SOOOOO MUCH trouble from here on out, i sure wish i had known about that for the past 4 years instead of putting message boxes everywhere while "debugging" just to see where my script was hanging. If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version 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