Test if Window is Open

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
dagdag
Newbie
Posts: 4
Joined: Mon Feb 06, 2006 4:15 pm

Test if Window is Open

Post by dagdag » Mon Feb 06, 2006 4:17 pm

Hi, in one of my scripts , I start by closing a specific window. But if this window is not open , the script fails. How to check if the window is closed then go and do something else - thanks

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Feb 06, 2006 5:07 pm

I think what you really want to do is check if it's open.

If it is Open, then you can Close it Else continue as desired.

Code: Select all

IfWindowOpen>WindowName*,Close,NextStep

Label>Close
WindowAction>3,WindowName*

Label>NextStep
Do stuff ......
...
...
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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

Post by Marcus Tettmar » Mon Feb 06, 2006 6:02 pm

Or, if you have 7.3 or later, you can do:

IfWindowOpen>window_title*
..
..
else
..
..
endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

dagdag
Newbie
Posts: 4
Joined: Mon Feb 06, 2006 4:15 pm

Test if Window is Open

Post by dagdag » Mon Feb 06, 2006 6:14 pm

Thanks- Both solutions work -

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