Window Operations * SCW.

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Window Operations > SCW. - Search-Child-Window >

Window Operations * SCW.

"t" - Flag "text"

Previous Top Next


MiniRobotLanguage (MRL)

 

"t" - Flag "text"

Search Child 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 button or child-window.

 

SCW.t|Yes

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

SCW.t|next

 

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

 

' Lets start with this

SCW.t|{&DOCAPS:Next}

 

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

 

' This will not find the window

' because of case-sensitivity!

STW.t|{&DOCAPS:next}

 

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

Now how about this:

 

SCW.nct|2|Button|{&EXACT:&next}

 

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

Try this:

 

STW.t|{&EXACT:ext}

 

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'll try this with Top-Windows here, because its less to type. The patterns work in the same way with child-windows.

 

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.

 

 

 

Short Examples:

 

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

 

 

 

 

Example

 

-

 

 

Remarks

 

-

 

 

Limitations:

 

 

 

 

See also:

   

    1. STW. - Decription

    SCW - Search-Child-Window

    1.4. The Prototype Parameter System

    3.2 Standard-Search Pattern

    "n" - Flag - SCW.

    "r" - Flag - SCW.

    "S" - Flag - SCW.