Is there a script to detect message or alert boxes?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
usernamechan
Newbie
Posts: 10
Joined: Wed Apr 18, 2007 5:51 pm

Is there a script to detect message or alert boxes?

Post by usernamechan » Wed May 09, 2007 4:15 pm

I can't run my script to automate some Web processes unattended. Every time I leave it running for any extended period unattended, I would come back to some alert boxes needing a click on "ok". How do I detect these elements? For instance, the Web site goes into maintenance and pops up an alert box. What is the best way to handle this or similar types of occurrences?
________
mexicocity hotel
Last edited by usernamechan on Tue Feb 01, 2011 12:27 pm, edited 1 time in total.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed May 09, 2007 4:23 pm

Use a WINDOW_OPEN OnEvent handler to detect and process dialogs that appear randomly.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

usernamechan
Newbie
Posts: 10
Joined: Wed Apr 18, 2007 5:51 pm

Post by usernamechan » Thu May 10, 2007 3:26 am

Can anyone give an example on how to use OnEvent to detect and process some random dialog?
________
Mercedes-Benz 600 (disambiguation) specifications
Last edited by usernamechan on Tue Feb 01, 2011 12:27 pm, edited 1 time in total.

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Sat May 12, 2007 2:44 pm

Taken from the help file:

Code: Select all

OnEvent>WINDOW_OPEN,Notepad*,2,DoNotepad

Label>start
Wait>1
If>NotepadOpen=1
   Message>Notepad is open
Else
   Message>Notepad is not open
Endif
Goto>start

SRT>DoNotepad
Let>NotepadOpen=1
END>DoNotepad
Search for OnEvent in the help file or use the online help section at http://www.mjtnet.com/onlinehelp.htm

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts