Browser and Office Commands

<< Click to Display Table of Contents >>

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

Browser and Office Commands

AMS. - Acc.- Multi Scan (Visual Acc.-Object Scan) 

Previous Top Next


MiniRobotLanguage (MRL)

 

AMS. 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. AMS. uses a scanning technique instead of a search technique.

Therefore AMS. can find Acc.-Objects that can not be found using any other command. Technically the AMS. 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 AMS..

 

You can see Acc-Objects in the Acc.-Inspector. If you see Acc.-Objects in teh Acc.-Inspector, but you can not localize them with any of the search commands, then AMS. can get them for you. This is where AMS. can be used.

 

AMS. uses multiple CPU-Cores at the same time to speed things up. Therefore the time, AMS. 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.

 

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

 

graphic

 

In the picture below you will see the resulting Display in the Acc.-Inspector.

 

graphic

 

The most important parameters for AMS. are:

"name", "role" and "value" and we also have "Step". In most cases you can ignore the other parameters.

 

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

 

Using AMS. 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:}

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

 

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.

 

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

 

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

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

 

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

 

AMS. 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 AMS. can be quite slow when being used on large windows and with slow Computers. AMS. will speed up with multiple CPU cores, the more the better.

 

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

 

 

 

Syntax

 

AMS.[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) Step. A numeric value that is the raster-size, of the scanning-net. The higher this parameter, the faster AMS. 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.

         

 While all parameters are marked as "optional", you need to specify some of them. An empty AGR. does not make any sense.

 

 

*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

 

' Example comparing AVF. with AMS

'

STW.ct|IEFrame|Theo Gottwald

AVF.40||ing-diba|1|70

MMV.

AMS.40||ing-diba|1|70

MMV.

DMP.1

MBX.1

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 command will speed up with a growing number of CPU-Cores.

 

 

 

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

    Acc.-Visual Find