DelioPontes Posted July 19, 2014 Share Posted July 19, 2014 Hi all I need your help again... For some reason the script dont repeat the loop if can not find, one of the error dialog boxes... for example if the script can not find the error 50, the script stops on the last action before, in this case on error 18 But I need the script restart again after error 18 or 50 (press again save and look again for new errors...) And stops only when find the.dialog box "Successfully saved shared data to revision". Can someone help me? this is the code until now: #include <MsgBoxConstants.au3> Example() Func Example() Local $sAnswer = InputBox("BUZ OFF!!!", "Project name?", "" , "") & "" Do Local $hWnd = WinWait($sAnswer) WinSetState($hWnd, "", @SW_SHOWNORMAL) if WinExists("Colorize scan"& "") then WinWaitClose("Colorize scan"& "") endif if WinExists("Saving shared data...") then WinWaitClose("Saving shared data...") EndIf IF WinExists($sAnswer) Then Send("^s") EndIf WinWaitActive("Share Changes") if WinExists("Share Changes") then ControlClick("Share Changes", "", "[CLASS:Button; INSTANCE:1]") endif WinWaitActive ("SCENE","Saving shared data failed! Error Code: 18.") if WinExists("SCENE","Saving shared data failed! Error Code: 18.") then ControlClick("SCENE", "", "[CLASS:Button; INSTANCE:1]") EndIf WinWaitActive ("SCENE","Saving shared data failed! Error Code: 50.") if WinExists("SCENE","Saving shared data failed! Error Code: 50.") then ControlClick("SCENE", "", "[CLASS:Button; INSTANCE:1]") EndIf Until WinExists("SCENE", "Successfully saved shared data to revision" & "") Link to comment Share on other sites More sharing options...
czardas Posted July 19, 2014 Share Posted July 19, 2014 (edited) If no window appears matching the specified criteria WinWaitActive ("SCENE","Saving shared data failed! Error Code: 18.") , the script will hang until that window does appear. This could be what is happening. If that window does not appear, you will never reach the end of the loop. Edited July 19, 2014 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
DelioPontes Posted July 19, 2014 Author Share Posted July 19, 2014 Hi czrdas, Thanks for the tip, I will try to solve the problem without that expression Link to comment Share on other sites More sharing options...
czardas Posted July 20, 2014 Share Posted July 20, 2014 (edited) The same applies for any call to WinWaitActive(). The script will wait for each window. It is unlikely that both error codes (18 & 50) will occur. I suggest you try to rewrite your code and also check out the following functions in the help file: ExitLoop & ContinueLoop. Edited July 20, 2014 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
DelioPontes Posted July 20, 2014 Author Share Posted July 20, 2014 It works! Thanks a lot! czardas 1 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