Test if Window is Open
Moderators: JRL, Dorian (MJT support)
Test if Window is Open
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
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
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.
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!
Bob
A humble man and PROUD of it!
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Or, if you have 7.3 or later, you can do:
IfWindowOpen>window_title*
..
..
else
..
..
endif
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Test if Window is Open
Thanks- Both solutions work -