Browser and Offce Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Browser and Office (Acc.-Engine) >

Browser and Offce Commands

AVF. - Acc.- Visual Find (Visual Acc.-Object Scan) 

Previous Top Next


MiniRobotLanguage (MRL)

 

AVF. Command

Scan for Accesible Object

 

 

Intention

 

This command localizes a specified Acc.-Object in a Child-Window or Top-Window and sets the actual point into the object center.

 

Unlike SAO.,AFT.,AGR. etc. AVS. uses a scanning technique instead of a search technique.

Therefore AVF. can find Acc.-Objects that can not be found using any other command. Technically the AVF.

does the same, like when you use the Acc.-Inspector from the Editor, and drive through the window, scanning for a object.

 

Therefore only Objects that are currently visible and on Top can be scanned/searched using AVF.

You can see Acc-Objects in the Acc.-Inspector. If you see Acc.-Objects in the Acc.-Inspector,

but you can not localize them with any of the search commands, then AMS. or AVF. can get them for you. This is where AMS. and AVF. can be used.

 

AVF. uses multiple CPU-Cores at the same time to speed things up.
Therefore the time, AVF. needs to locate an object depends heavily on the size of the window, and as well on the number and speed of the CPU cores.

 

AMS. and AVF. use different internal Implementation. Also AVF. leaves other information on the TOS.

In terms of Speed both are similar fast.

 

clip0085

In this Sample AVS. is a bit faster

 

 

clip0088

In this Sample AMS. is faster

 

Here are some Speed Considerations:

First we use a step of 7 (Default)

clip0089

Here we use a Step-Value of 7

 

 

Second we use a step of 70: Note that AVF. will internally scale down if it does not find anything until the Step-Value is smaller then 4.

clip0090

Here we use a Step-Value of 70 which is significantly faster.

 

 

Let us see an example from a WEB-Site in the Internet Explorer:

 

graphic             graphic

 

In the second picture above you see the resulting Display in the Acc.-Inspector.

 

The most important parameters for AVF. are:

"name", "role" and "value" and we also have "Step".

Now we'll take the above picture from the Acc.-Analyzer, and make the code for it.

 

Using AVF. we do best locate a Top- and a child-window. Like this:

 

STW.ct|IEFrame|Theo Gottwald&ANDTHEN: - Windows Internet Explorer

SCW.ct|Shell DocObject View|{&NOTEXT:}

AVF.40||google&ANDTHEN:nwshp

MMV.

ENR.

 

In some cases this may not be possible, or will not work. Then we can use AGR just on the Top-Window:

 

STW.ct|IEFrame|Theo Gottwald&ANDTHEN: - Windows Internet Explorer

AMS.40||google&ANDTHEN:nwshp|1|25

MMV.

ENR.

 

 

clip0083                       clip0084

This is the TOS when we have found something.                                                This is the TOS when we did not find anything.

 

Which may be a bit slower in execution times, depending on the overall complexity of the WEB-/Office program.

 

If the target application is an Internet explorer, AMS. will not scroll to bring the located object into the visible area. It will not find any element that is not completely visible for scanning. Therefore use the SWP. command, to make sure that the window has a sufficient size.

 

Use AVF. with a larger Step value, for example the Size of the object. It will automatically scale down internally if it does not find anything.

This is the major difference to AMS.

 

AVF. will never work behind a cover, like the cover that can be created using the UCV. command.

 

AVF. supports the use of so called "Role-Parameter". These are Inline-Subcommands which get executed only if the object could be found. Here is an example:

 

' The "Inline MOS." will select the Link in the IE

AVF.40!MOS.||google&ANDTHEN:nwshp

 

For a complete list of all "Role-Parameters" see below.

 

Hints:

It is important, that you localize a window before using AVF.

Unlike SAO., the AVF. command does not use the 1.4. The Prototype Parameter System.

AVF. supports 3.2 Standard-Search Pattern and they can help you to better define the things you look for. See example above "google&ANDTHEN:nwshp".

Please note that AVF. can be quite slow when used on large windows and with slow Computers. AVF. will speed up with multiple CPU cores, the more the better.

 

Keep your Target-Window as small as possible when using AVF. or AMS.

 

Use the Acc.-Inspector in the Editor to get the necessary parameter data.

 

 

 

Syntax

 

AVF.[P1][|P2...|Px]

 

 

Parameter Explanation

 

P1 - (optional) Role, and Role-Parameter, a numeric value as you it in the Acc.-Inspector, when you are over the element with the mouse. You can specify additional "Subcommands" after the Role-Parameter* (See below), separated by a "!". Example:

 

AMS.40!WII.MLE.||google&ANDTHEN:nwshp

 

P2  - (optional) Name, a string / text as you it in the Acc.-Inspector, when you are over the element with the mouse.

 

P3 - (optional) Value, a string / text as you it in the Acc.-Inspector, when you are over the element with the mouse.

 

P4 - (optional) Number of the element. There may be multiple elements that fit your description. In that case you can choose which one you want using this parameter. You need to try which number you need to locate the element of your choice.

 

P5 - (optional) Pixel-Step. A numeric value that is the raster-size, of the scanning-net. The higher this parameter, the faster AVF. will work.
          Imagine the Step parameter like the size of the holes in a fisher net. The larger the holes, the bigger the fishes have to be, to be caught.
          The default value is 5. A good number would be, a bit less then the half size of the element you are looking for, in pixels.

 

Special when using AVF:          

Use AVF. with a larger Step value, for example the Size of the object. It will automatically scale down internally if it does not find anything.

This is the major difference to AMS. Technically AVF: will run with the given large Step-Value and if it did not find anything it will run again with the step value of half the size until the step values is below 3.

 

If the Object can not be found this may take a while, even a Minute. If you do not want that use AMS. instead.

 

*Role-Parameter:

These inline-commands can be specified together with the role-parameter, separated by a "!". You can specify as man of them as you wish. They will only get executed, in case of an element is found:

 

"TAF" - "a" ' Take Focus

"TAS" - "b" ' Take Selection

"ESE" - "c" ' Ext. Select

"ASE" - "d" ' Add to Selection

"RSE" - "e" ' Remove Selection

"SSE" - "f" ' Strong Select

"SHC" - "g" ' Shift-Click

"CCS" - "h" ' ctrl-click - select

"CSE" - "i" ' ctrl-click cancel selection

"MER" - "j" ' MER at Pos.

"MSE" - "k" ' do Multiselect

"MOS" - "m" ' Mouseless Operation Select

"DMO" - "n" ' Double Mouseless Operation Select

"MLI" - "o" ' MLI at place

"DMR" - "p" ' Double Mouseless Operation Select with rest

"MPO" - "q" ' Mousepointer Position Set

"MSO" - "r" ' Mouse Operation

"MDO" - "s" ' Mouse Double Operation

"WIN" - "t" ' Set Wait-Input Idle- Time to infinte

"MDC" - "u" ' MDC at place

"MRC" - "v" ' MRC at place

"WII" - "w" ' Wait-for-Input-Idle (max. 5 Seconds)

"MLE" - "x" ' MLE.

"SMP" - "y" ' Set Mousepos Mode

"BTP" - "z" ' Set Left-ControlPosition like for Checkmark

"BTC" - "0" ' check State before click and click

              if actually state=0 (check it)

"BTS" - "1" ' check State before click and click if actually

              state=1 (uncheck it)

 

P6 - (optional) Waiting Time. if given, AGR. will wait the specified amount of

          time if that specified Object will appear. Needed to wait for WEB-Sites or in

           Setup Scripts.

 

P7 - (optional) On NOT Found Jump to. if given, AGR. will jump to the

           specified Label, if that specified Object is not found in the specified time.

 

 

 

 

Example

 

' This Example will find an item in the Internet Explorer

' on a WEB-Site and select that item mouse-less.

STW.ct|IEFrame|theo&ANDTHEN: - Windows Internet Explorer

AMS.40!MOS.||focus

ENR.

 

 

' Choosing a raster size of 40 is possible for long elements

' and will speed up search significantly

'

STW.ct|IEFrame|theo&ANDTHEN: - Windows Internet Explorer

AMS.40||focus|1|40

MMV.

ENR.

 

 

 

Remarks

 

This is one of the Slowest commands, therefore keep the size of the target-window as small as possible.

Increase P4 to half the size of the Object that you want to search, this will speed up the command significantly.

 

This command will also speed up with a growing number of CPU-Cores.

If possible use the new Pattern-Search Commands or AGR. instead of these Commands.

In a Target Window 576x1090 i received scanning times of up to 17 Seconds.

 

 

Limitations:

 

This command can be slow on large windows.

 

 

 

See also:

 

    !. NAV - NAVigate in Dialog

    MOS. - Mouseless Object Select

    GAI. - Get-Acc-Information

    SAO. - Search Accessible Object

    AFT. - Acc.- Find Text

    AGR. - Accessibility Get Rect

    AMS. - Acc-Multi-Scan