Jump to content
Sign in to follow this  

Count the number of annoying messages clicked automatic by the script

Recommended Posts

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>
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]")
if WinExists("SCENE") then ControlClick("Saving shared data failed! Error Code: 27.", "", "[CLASS:Button; INSTANCE:1]")
if WinExists("SCENE", "Successfully saved shared data to revision" & "") then Exit 0
Edited by DelioPontes

Share this post

Link to post
Share on other sites

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 by l3ill

Share this post

Link to post
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
Sign in to follow this  

  • Create New...