I have a script that needs to wait for an error message that may or may not appear. If it does not the message box goes away in two minutes. I would also like to react to the OK button on the message box and drop out of MainLoop. Below is the code any suggestions will be appreciated.
Let>MSG_STAYONTOP=1
Let>MSG_CENTERED=1
Let>WW_TIMEOUT=60
Let>Counter= 0
Message>Waiting Two Minutes for "At Least One Service Failed Message"
Label>MainLoop
Wait>0.5
FindWindowWithText>failed during,1,WindowName
If>WindowName=Service Control Manager ,FoundWindow
Let>Counter=Counter+1
if>Counter>120,NotFound
Goto>MainLoop
Label>FoundWindow
//Now Close the Service Control Manager Message
SetFocus>Service Control Manager*
Wait>0.5
MouseMoveRel>199,91
Wait>0.5
LClick
Label>NotFound
//This will close the message Window
SetFocus>Macro Scheduler Message
Wait>0.5
MouseMoveRel>133, 176
Wait>0.5
LClick