<< Click to Display Table of Contents >> Navigation: 3. Script Language > Window Operations > ITW. - If Top Window > Window Operations * ITW. / NTW. |
MiniRobotLanguage (MRL)
"t" - Flag "text"
If Top Window
Intention
This flag is one of the most important search parameters. It is the window-text. Most often you can even see the text of a top-window without using the windows-Inspector.
Here is the simplest case how you can grab a window.
ITW.t|TestApp
MMV.
The text parameter is a string-value and therefore supports 3.2 Standard-Search Pattern .
Let us try some of these.
As always with Search patterns, it is enough to give a unique part of the value. By default the text is not case sensitive. You can change that behavior using the search patterns. Take the sample-script below and replace the line:
' Locate the window
ITW.t|Testf
with the following lines. This will help you to understand the use of Patterns for text search.
' Lets start with this
ITW.t|{&DOCAPS:Testf}
This will force the text to be case-sensitive! Try this:
' This will not find the window
' because of case-sensitivity!
ITW.t|{&DOCAPS:testf}
It does not find the window because the &DOCAPS: switches case-sensitivity on.
Now how about this:
ITW.t|{&EXACT:bcs - Testform}
It does find the window. But then whats the "&EXACT:" good for?
Try this:
ITW.t|{&EXACT:bcs - Testf}
It does not find the window because the &EXACT: switches off the default behavior that a part of the text is enough. CAn it be combined with the &DOCAPS: ?
We try. This should work:
ITW.t|{&EXACT:&DOCAPS:BCS - Testform}
and this should not work:
ITW.t|{&EXACT:&DOCAPS:bCS - Testform}
Yes, everything work as expected.
Do you know the old times, when you had simple Wildcards as patterns? The"*" and the "?" ?
You can have them back if you want. Try this:
ITW.t|{&WILDC:b?? - Testform}
Yes, it works. And how about:
ITW.t|{&WILDC:b?? - Tes*orm}
or
ITW.t|{&WILDC:b?? - *s*or?}
It works.
We kept them for you.
You can still use even the old DOS-Patterns if you really want.
But there is much more if you use the new patterns.
How about a fuzzylogic and a OR'ed combination of two patterns?
ITW.t|{&WILDC:b?? }&OR:{BCS-tesform&FUZZY:6}
and you can not only combine two patterns, you can combine as many patterns using &OR: as you like! If you want to support many languages, this is the way to go.
No matter if there is a "YES" on that button or a "Qui" or whatever. So long you know it, or at least a bit of it, you can locate it using Search patterns.
Important Note:
Never forget the EIF. when using ITW.. Of course you can also use ELS. We have left this away in the examples above, to explain things shorter.
Example
' Close all such windows if there are some open
CAW.PBWindowClass:0|BCS - Testform
EXE.?exepfad\Sample Apps\BSC-Testform.exe
' Locate the window
ITW.t|Testf
' Close the window
CAW.PBWindowClass:0|BCS - Testform
EIF.
ENR.
Remarks
-
Limitations:
-
See also: