Browser and Office Commands

<< Click to Display Table of Contents >>

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

Browser and Office Commands

AGR. / AGF. - Acc.-Get Rect  (Search Acc.-Object) 

Previous Top Next


MiniRobotLanguage (MRL)

 

AGR. Command

Search Accessible Object

AGF. Command

Search Accessible Object Fast

 

Compatible Engine_01Direct Engine_01

 

Intention

 

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

It's similar to SAO. but it does not use the 1.4. The Prototype Parameter System for its parameters. Therefore it has only the basic options, but may be easier to use.

 

AGR. is using just one CPU-Core and therefore the order in which you find Objects is clearly defined.

AGF. uses multiple CPU-Cores, this makes it faster on large search operations, but does not allow you to specify the order in which objects are returned.

As we can not know which CPU finds which Object first.

 

 

clip0091

 

 

You can see Acc-Objects in the Acc.-Inspector.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 AGR. are:

"name", "role" and "value". 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 AGR. 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:}

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

AGR.40||google&ANDTHEN:nwshp

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, AGR. will scroll to bring the located object into the visible area.

 

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

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

 

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

 

AGR. 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 AGR. can be quite slow when being used on complex applications and slow Computers.

 

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

 

If you use the AGR.-Command for automated Installations, like for Office 2007 or Office 2010, its absolutely necessary that you specify the Flag 19.

Otherwise the AGR. Command will localize invisible elements and the installation will not work as expected.

 

 

 

Syntax

 

AGR.[P1][|P2...|Px]

AGF.[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:

 

AGR.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) Flags. A numeric value that is a combination of the below numbers.

 

    1 - only Objects,

    2 - only Simple Elements

    4 - display debug info while searching.

    8 - if set, then elements with the %STATE_SYSTEM_INVISIBLE

                  will also be found.

   16 - if set, then elements with the %STATE_SYSTEM_INVISIBLE

                  or the %STATE_SYSTEM_UNAVAILABLE will also be found. Needed for Setup

                  automation, like MS-Office  2007 or 2010.

      32 - NoScroll-Flag. Using this Flag, you can permit AGR to scroll in the Internet

                Explorer.

 

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

 

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.

 

*Role-Parameter:

You can specify multiple Roles, they must be separated by ",".
Any of these will be valid.
 
If you specify a "#" before the Role-Parameter, it will mean "Role-Group" and specifies any of the following:

0: unknown

1: User-bedienbare Controls

2: Panels, Client und Background

4: Borders etc.

8: Window-Controls (Titlebar, Minimize etc.)

16: Scrollbars

32: Spezial, Cursor, Sound etc.

 

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)  

 

 

 

 

Example

 

' This Example will find an item in the Internet Explorer

' on a WEB-Site

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

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

AGR.40||google&ANDTHEN:nwshp|1|64

MMV.

ENR.

 

 

 

Remarks

 

-

 

 

 

Limitations:

 

This command can be slow on complex applications. In such case use AGF. insteead of AGR.

You can not use this command to wait for a WEB-Site to be opened as it tries to analyze internal structures that are going to be rebuild in the WEB-Site.

Using this commands on WEB-Sites that do just load/rebuild internal structures may lead to all sorts of crashes.

Using the command on a WEB-Site that is going to be opened, may therefore result in a unrecoverable crash of the robot program.

 

 

 

See also:

 

    !. NAV - NAVigate in Dialog

    MOS. - Mouseless Object Select

    GAI. - Get-Acc-Information

    SAO. - Search Accessible Object

    AFT. - Acc.- Find Text

KBC. - KeyBoard Command