DelioPontes Posted July 19, 2014 Share Posted July 19, 2014 (edited) Hi all! I wrote a code that save and click automatic "ok" in annoying dialogbox boxes error messages from a software that I work a lot. The script is almost finished and until now is working correct! For experts...I just would like to know if will be difficult to create a code to count how many annoying boxes errors opened during the script execution and when the script stop show that number in a final textbox. Because I think in some projects this software will open more 1000 error messages.... Someone can give me a help whrere I need to start? The dialog boxes I would like to be count are "Share Changes" and "Saving shared data failed! Error Code 27." Cheers and thanks in advance My code until now: #include <MsgBoxConstants.au3> Example() Func Example() Local $sAnswer = InputBox("BUZ OFF!!!", "Project name?", "" , "") & "" While 1 Local $hWnd = WinWait($sAnswer) WinSetState($hWnd, "", @SW_SHOWNORMAL) if WinExists("Colorize scan"& "") then WinWaitClose("Colorize scan"& "") if WinExists("Saving shared data...") then WinWaitClose("Saving shared data...") IF WinExists($sAnswer) Then Send("^s") WinWaitActive("Share Changes") if WinExists("Share Changes") then ControlClick("Share Changes", "", "[CLASS:Button; INSTANCE:1]") WinWaitActive("SCENE") if WinExists("SCENE") then ControlClick("Saving shared data failed! Error Code: 27.", "", "[CLASS:Button; INSTANCE:1]") WinWaitActive("SCENE") if WinExists("SCENE", "Successfully saved shared data to revision" & "") then Exit 0 WEnd Edited July 19, 2014 by DelioPontes Link to comment Share on other sites More sharing options...
JohnOne Posted July 19, 2014 Share Posted July 19, 2014 Add a $count variable that increments each time it shuts a window. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
l3ill Posted July 19, 2014 Share Posted July 19, 2014 (edited) I have done similar counts by adding a text file to my script folder and using for instance: $Var = FileReadLine textfile FileWriteLine textfile $Var = 1 $Var = $Var + 1 Edited July 19, 2014 by l3ill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
mikell Posted July 19, 2014 Share Posted July 19, 2014 As JO said, something like this $count = 0 While 1 ; ..... if WinExists("Saving shared data...") then WinWaitClose("Saving shared data...") $count += 1 EndIf ; ...etc if WinExists("SCENE", "Successfully saved shared data to revision" & "") then Exit Msgbox(0,"", $count) WEnd Link to comment Share on other sites More sharing options...
DelioPontes Posted July 19, 2014 Author Share Posted July 19, 2014 (edited) ok , thanks all for the help I will test now... Edited July 19, 2014 by DelioPontes 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! 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