! Smart Package Robot 's Mouse-Operations / MOS. - Mouseless Object Select

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Mouse-Operations >

! Smart Package Robot 's Mouse-Operations / MOS. - Mouseless Object Select

MOS. - Mouseless Object Select

Previous Top Next


MiniRobotLanguage (MRL)

 

MOS. Command

Mouseless Object Select (direct engine / Accessibility / focussless technology)

 

Direct Engine_01

 

Intention

 

The MOS -Command can be used to simulate a many different actions, like a mouse-click and other actions without really using or moving the mouse.

 

It is based on accessibility and will preferably work with objects that have been located using SAO., NAV. or AGR., like in this example:

 

STW.ct|PBWindowClass:0|BCS - Testform

AGR.43|Install

MOS.

 

MOS. is perfect for clicking for example Links in the WEB-Browser, even if they are actually not visible.

 

To use MOS., you need to locate these elements first for example, using the SAO., NAV. or AGR. Command.

 

MOS. understands a "subscript" that can be given as command-line. For example:

 

STW.ct|PBWindowClass:0|BCS - Testform

AGR.43|Install

MOS.WIN.MPO.DMO.WII.

ENR.

 

You can find a list with these "Subscript-commands" below. In our example the following will happen:

 

MOS.WIN.MPO.DMO.WII.

 

WIN. - we set the internal value for WII. to infinte

MPO. - the mouse jumps to the target position (it will jump back later!)

DMO. - we'll click two times (mouse-less - its just a demo)

WII. - we will wait until the application is ready again for new actions

 

You can try this script with the supplied BCS-Testapplication.

 

MOS. has a special feature for checkmarks. We'll now use it on our BCS-Testform. This feature comes with the two "sub-commands" BTC. and BTS. Please do not intermix these "sub-commands" with the real BTC. command.

They have just the same name, but are different things..In this case, BTC. - means "Button clear" and BTS. means "Button Set". These two wubcommands are specially to have a checkmark or radio button SET  or CLEARED.

The BTC. sub-command must be followed by a mouse-click-sub-command to be complete.

This way you can choose which kind if mouse-click you want to do. It will look like this:

 

STW.ct|PBWindowClass:0|BCS - Testform

AGR.44|agree

MOS.BTS.MLE.

ENR.

 

graphic

 

And to have that checkmark cleared, you would use:

 

' direct engine click

MOS.BTC.MLE.

 

or as alteranatice

 

' compatible engine click.

MOS.BTC.MLI.

 

Note that in case its a real child-window and not an web-based object, you can also use SCW. instead of AGR. or SAO. to locate it like this:

 

STW.ct|PBWindowClass:0|BCS - Testform

SCW.ct|button|agree

MOS.BTS.MLE.

ENR.

 

Using any kind of mouse clicks,.this will also work as expected. However if you want to use the MOS. (mouseless operation) sub-command, you need to have the target located using AGR. or SAO. or NAV. Anything else may not work. Especially SCW. would not work in this case.

 

STW.ct|PBWindowClass:0|BCS - Testform

AGR.44|agree

'This will also work

MOS.BTC.MOS.

ENR.

 

After execution, the MOS. - Command will drop a 0 or 1 onto the stack, to show if the command was successful (1) or not (0). If the command was not successful then a possible reason is that the control does internally not support the used interface.

 

MOS. has a lot of options/sub-commands, see below. The options from "a" to "i" and "k", are mostly for selecting items in List-controls. The other sub-commands are Mouse-operations and Waiting operations.

 

Using our TestApp_01.exe, here is an example that shows how to use the sub-commands to select the items: 4,5 and 8:

 

STW.ct|PBWindowClass:0|TestApp

SCW.nct|1|ListBox|List-Item Nr.1

SAO.rn|34|List-Item Nr.4

MOS.TAS.

SAO.rn|34|List-Item Nr.5

MOS.CCS.

SAO.rn|34|List-Item Nr.8

MOS.CCS.

ENR.

 

In Listboxes, the items must not be visible to become selected.

You can also select item 18, which will then get visible.

 

STW.ct|PBWindowClass:0|TestApp

SCW.nct|1|ListBox|List-Item Nr.1

SAO.rn|34|List-Item Nr.4

MOS.TAS.

SAO.rn|34|List-Item Nr.5

MOS.CCS.

SAO.rn|34|List-Item Nr.18

MOS.CCS.

ENR.

 

Note that CCS. will extend (add items to) an existing selection, while TAS. will remove all current selections and start with a new selection. MOS. may also be useful with other controls to select and unselect items.

 

 

 

Syntax

 

MOS.P1

 

 

Parameter Explanation

 

P1 - Optional subscript (inline)-commands:

 

"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

 

'----------------------------------------

' MOS-Example 1

' This example Script will click a

' button in the BCS-Testapp

'----------------------------------------

DBM.2

STW.ct|PBWindowClass:0|BCS - Testform

AGR.43|Install

MOS.WIN.MPO.DMO.WII.

ENR.

END.

 

 

 

Remarks

 

You can use these sub-commands to make extended selections in List-Objects like Listview or Listbox.

 

 

 

Limitations:

 

Please note that not all List-Controls support this command, while most other elements in windows or IE-Browser support MOS..

 

 

 

See also:

 

    1.C Direct Engine and Compatible Engine

    MLE. - Mouse-Left-Click Event

    MLM - Mouse Left click Move (Invinsible)

    MLI - Mouse Left Click quIckly (Invinsible)

    MRC. / MRI. - Mouse-Right-Click

    MMV - Mouse MoVe

    OPT. - Optional Settings

    BSC. - Button Special Click

    BCS. - Button Click Special