Window Operations * STW.

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Window Operations > STW. - Search Top Window >

Window Operations * STW.

"t" - Flag "text"

Previous Top Next


MiniRobotLanguage (MRL)

 

"t" - Flag "text"

Search 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.

 

STW.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

STW.t|Testf

 

with the following lines. This will help you to understand the use of Patterns for text search.

 

' Lets start with this

STW.t|{&DOCAPS:Testf}

 

This will force the text to be case-sensitive! Try this:

 

' This will not find the window

' because of case-sensitivity!

STW.t|{&DOCAPS:testf}

 

It does not find the window because the &DOCAPS: switches case-sensitivity on.

Now how about this:

 

STW.t|{&EXACT:bcs - Testform}

 

It does find the window. But then whats the "&EXACT:" good for?

Try this:

 

STW.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:

STW.t|{&EXACT:&DOCAPS:BCS - Testform}

and this should not work:

STW.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:

 

STW.t|{&WILDC:b?? - Testform}

 

Yes, it works. And how about:

 

STW.t|{&WILDC:b?? - Tes*orm}

or

STW.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?

 

STW.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.

 

 

 

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

STW.t|Testf

 

' Close the window

CAW.PBWindowClass:0|BCS - Testform

ENR.

 

 

Remarks

 

 

 

 

Limitations:

 

 

 

 

See also:

 

    3.2 Standard-Search Pattern

    "c" - Flag - STW.