In MS there is some If-like commands (IfWindowOpen, IfWindowClose, and so on).
You can put two labels, the firs if the event occurs, the second if not.
I think it would be nice if MS let you leave blank the first label (ie, put the comma) so that go to label only if NOT condition.
Something like:
IfWindowsOpen>Notep*,,serr
(Then, if there is no windows open with name Notep*, it would go to label "serr")
Labels in If commands
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
From the Help File:
Even though first True parameter is mandatory, all you need to add is one more line to continue if True:IfWindowOpen>window_title,label_name[,false_label_name]
Checks to see if the specified window is open. If so, it causes the script to continue from the specified label without running any other lines of code in between. If a second false label is specified, execution will jump to that label if the expression resolves false. Subroutine names can also be specified
Someone else could make the same argument that script should continue here vs. jumping if Window is not open. I don't think 1 extra line is a big deal for the greater flexibility this structure provides.IfWindowOpen>notepad*,DoNotepad,NotepadDone
Label>DoNotepad
....normal continuation of script if Window Open is True
....
....
Label>NotepadDone
....
....
....
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!