Control specific operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Control specific operations >

Control specific operations

SCI. - Set-Combo/Listbox-Item

Previous Top Next


MiniRobotLanguage (MRL)

 

SCI. Command

Select Combo Item

 

Direct Engine_01

 

Intention

 

With this command you directly select a specified combo box entry.

You can specify the entry to select, by its name, 1 based index or position.

 

Here is a Picture of a Combobox with item Nr.4 selected.

 

graphic

 

It is important, that you first locate a Combobox. To do this, You can use SCW. as well as SAO..

 

In our Test-Application this would look like:

 

STW.ct|PBWindowClass:0|TestApp

SCW.nc|3|ComboBox

 

Once this is done, the computer knows in which Combobox you want to select an item.

When choosing an item "by text", you can use 3.2 Standard-Search Pattern or just give a unique part of the text you want to select.

 

SCI.Item-Nr.7

 

As alternative, you can select an item by its 1-based item-index. If you count the items from top to bottom, the most upper item has Nr.1, the next is Nr.2 ... until you reach the bottom item. For this you would write:

 

SCI.7|N

 

Which would select the same item as before. In case you want to make sure that P1 is a text item (part of), you can use the T(ext) instead of the N(umeric).

 

SCI.Item-Nr.7|T

 

And in this case you also have the chance to add a item-number. For example in our Testapplication the script::

 

STW.ct|PBWindowClass:0|TestApp

SCW.nc|1|ComboBox

SCI.4|T|3

 

will make this item to be selected, as it is the third item that contains a "4".

 

graphic

 

Hint:

In case the SCI. will change the Combo-Item only visually, but not really, you can use a script like this below.

 

STW.ct|FORM_DIFF-TOOL_MAINDLG_CLASS:0|Robo-Diff

SCW.nct|1|FORM_DIFF-TOOL_REGOPTION_CLASS:3|Registry-Options

SCW.nic|1|1001|ComboBox

' Instead of SCI. we click on the Combobox to open it

MLE.

' Now we get the Combolbox

STW.Ac|combolbox

' Here we do the selection

AFT.34!MLI|HKEY_CURRENT_USER\Test

 

 

Here is another example:

 

Instead of
'SCI.MSK_ws.png

 

you write something like:
 

  ' Klick on the Combobox to open it

  STW.ct|#32770|Berechnung

  SCW.nict|1|83|ComboBox

  MLI.

 
  ' Treat it like a Menu and click on the Item

  STW.Ac|Combolbox

  ' Possible Commands are: SCI. | CDD.

  AFT.34!MLI.|MSK_ws.png

 

 

Syntax

 

SCI.[P1][|P2][|P3]

 

 

Parameter Explanation

 

P1  - A value like a number a text or variable

 

P2 - (optional) N tells the command that P1 is a numeric value for index access

 T tells the command that P1 is a text value. The default when P2 is missing.

 

P3 - (optional) Numeric value, fitting item number, in case there are multiple equal named items.

 

 

 

Example

 

' Selects the 1-based Index-Item Nr.34

 SCI.34|N

 

' Selects the Entry which contains "Hallo"

 SCI.Hallo -> Textangabe

 

' Selects the 3.rd Entry which contains "Hallo"

 SCI.Hallo|T|3

 CDD.

 

 

 

Remarks

 

SCI. is a direct engine command. In few cases where it might select the right item, but the application does not react on it, use CDD. additionally to open and close the Dropdown.This will often solve the problem.

 

 

Limitations:

 

 

 

 

See also:

 

    GCI. - Get-Combo-Item

    CDD. - Combo Drop Down

    SKP. Send-Key-Press

    SDT. - SenD-window-Text

    RST. - Replace Selected Text

    SKT. - Send-Key-Text