<< Click to Display Table of Contents >> Navigation: 3. Script Language > Control specific operations > Control specific operations |
MiniRobotLanguage (MRL)
SMH. Command
Set Menu Hook
Intention
These command will click a menu item in a popup-menu.
You can specify the menu item by text (also use 3.2 Standard-Search Pattern= or you can xpecify the menu item by number.
Additionally you can choose which action is been made with the located menu-item.
You can also use SMH. with customizing-Treeviews in MSI-Setup's. It will click in the upcoming Menü and select the item of your choice. Here is an example:
Here is an example that will paste something into a textbox in our Testapplication.
' Select the TestApp
STW.ct|PBWindowClass:0|TestApp
' Select the Textbox
SCW.nc|3|edit
' Tell Hook that soon a Menu will pop up, he should click
' Einfügen (engl. "Paste")
SMH.Einfügen
' Now we move the Mouse to the Textbox and click the right Mousebutton
MRC.
' This Pause is needed, because if the script ends, the SMH.
' will also end, before the Menu is been clicked!
PAU.2
ENR.
In case you have a deep-menu, you may combine SMH. with SAO.
STW.ct|PBWindowClass:0|TestApp
SAO.rn|12|Marker
SMH.Start
MOS.
STW.ActE|#32768|{&NOTEXT:}
SAO.rn|12|MarkerA
MOS.
PAU.1
Syntax
SMH.P1|P2
Parameter Explanation
P1 - action you want
c = use mouse click by using COMPATIBLE-ENGINE
d = use mouse click (MLE) by using DIRECTENGINE
e = use mouseless Mouseaction (the default) by using ENGINE8
p = no further action, set only the point on the actual entry
a = search menu item by by number (count separators)
m = search menu item by number (do not count seperators)
t = search menu item by text
i = mouse jump to point
v = mouse move to point
P2 - Argument to P1. It can be text or number.
Example
STW.t|sample ap
SMH.i|Submen&ANDTHEN:8
SAO.rn|12|edit
MLI.
SMH.Submen&ANDTHEN:12
PAU.3
SMH.i|Neu
MRC.
STW.c|#32768
SMH.Verknüp
SMH.c|Eigensch&AND:{&NOT:nvi}
'********************************************
' SMH._Sample with deep Menu
' use TestApp
'********************************************
STW.ct|PBWindowClass:0|TestApp
SAO.rn|12|Marker
SMH.Start
MOS.
STW.ActE|#32768|{&NOTEXT:}
SAO.rn|12|MarkerA
MOS.
PAU.1
MBX.Ready
ENR.
'********************************************
' SMH._Sample
'********************************************
' Select the TestApp
STW.ct|PBWindowClass:0|TestApp
' Select the Textbox
SCW.nc|3|edit
' Tell Hook that soon a Menu will pop up, he should click
' Einfügen (engl. "Paste")
SMH.Einfügen
' Now we move the Mouse to the Textbox and click the right Mousebutton
MRC.
' This Pause is needed, because if the script ends, the SMH.
' will also end, before the Menu is been clicked!
PAU.2
ENR.
######################################################
Subroutines to Click inside the Windows Explorer Menu (Win 10)
Note that the :MenuClick must be changed to the local Situation
to bring up the Explorer Menu.
Call liket this:
GSB.SetSizeBig
'===========================================================
:SetSizeBig
GSB.DoEMenu|Ansicht|&EXACT:Große Symbole
RET.
'===========================================================
:SetSizeMed
GSB.DoEMenu|Ansicht|Mittelgr
RET.
'===========================================================
:Sort_Typ
GSB.DoEMenu|Sortieren|Typ
RET.
'===========================================================
:DoEMenu
§§TMA=§§_01
§§TMB=§§_02
GSB.MenuClick
STW.AcE|#32768
GSB.DoCLickM|§§TMA
STW.Ac|#32768
HTV.§§MEN
GSB.DoCLickM|§§TMB
MAW.hp|§§MEN
RET.
'===========================================================
:DoCLickM
§§TMC=§§_01
SAO.rn|12|§§TMC
MPO.
MLI.
RET.
===========================================================
:MenuClick
STW.h|$$WIN
' THIS COORDINATE must be somewhere where a Explorer Menu comes up!
' This will find a place where the System-Menu will come.
AGR.33!WII.MRC.|||1|3|60
RET.
'===========================================================
Remarks
To find place where to click in the Windows-Explorer, you can use:
AGR.33!WII.|||1|3|60
MRC.
Limitations:
If you run into problems with Menus that are more then 2 Levels deep, use STW. with the "I"-Flag (Exclude-List) and SAO. and MLI. to select further Menu entries.
See also:
• SAO. - Search Accessible Object
• MRC. / MRI. - Mouse-Right-Click