<< Click to Display Table of Contents >> Navigation: 3. Script Language > Keyboard Typing Simulation > Keyboard Typing Simulation |
MiniRobotLanguage (MRL)
SKI. Command
Send Key Input
Intention
The SKI.-Command can be used to simulate Keyboard typing. SKI. is like if you really type something into the keyboard. This makes it very compatible with real typing.
SKI. uses internally KYU. and KYD. and can therefore intermixed with these Commands. It can also understand the Syntax from these Commands..
SKI. will work on any place, where you can also enter text using the keyboard.It will work in browsers, Java- and WEB-based controls.
Unlike with KYD. and KYU. you can type complete words into SKI. SKI. will internally format it and type it.
SKI.Hallo Welt
SKI. uses a special "Character by Character" Syntax. It will really type "Letter by letter". This is slower but it has its advantages in safety.
Here is an Example that will type something into Notepad.
As the ","-Sign is used as a delimiter for SKI. it can not be sent to the target window using SKI.
You can use the special Keycode {OEMComma} to send a Comma using SKI.
STW.ct|WordPadClass|Dokument - WordPad
SCW.nc|1|RICHEDIT50W|{&NOTEXT:}
MLM.w|423,139
SKI.This,{OEMComma},Hallo
SEK.{LALT}|1
SKI.{NUM_1},{NUM_4},{NUM_4}
SEK.{LALT}|0
ENR.
You can also use this {DN_ and {UP_ Option to just do it all in SKI.
STW.ct|WordPadClass|Dokument - WordPad
'SWP.2605,585|539,283|T
SCW.nc|1|RICHEDIT50W|{&NOTEXT:}
MLM.w|423,139
SKI.{DN_LALT},{NUM_1},{NUM_4},{NUM_4},{UP_LALT}
ENR.
'While especially this example could have been done more easy using SDH.
'Like this:
SDH.144
As it is just like if "somebody is really typing", it has all advantages and all limitations from that.
• The target control must have Input focus
• the target window must be in front
• you may need to wait a bit (PAU.0.5) after typing until the control is ready
• SKI. its slower then any direct engine command
• but its highly compatible
• it understands special keyboard-actions like ctrl- or Shift or Alt-Key (see below).
• It can not change the text of buttons or controls like SDT..
You can read more about Keyboard-Simulation and Text-Boxes in the chapter:
Syntax
SKI.P1
Parameter Explanation
P1 - VAR or STRING can contain all Low-Level-Keycodes, may also contain Letters or words. All must be separated by ",". See:
SKI. supports the prefix of {DN_ and {UP_ for all cases where you only want to press a button down and hold it, or release a pressed button.
Note:
1.You can use this command to open Menu-Items using the Keyboard.
2. Always use small letters. In the context of this command, letters are generally small, unless additionally the SHIFT-Key is pressed.
Example
STW.ct|WordPadClass|Dokument - WordPad
SCW.nc|1|RICHEDIT50W|{&NOTEXT:}
MLM.w|423,139
SKI.{DN_LALT},{NUM_1},{NUM_4},{NUM_4},{UP_LALT}
ENR.
' SKI. can be used with Variables
STW.ct|WordPadClass|Dokument - WordPad
SCW.nc|1|RICHEDIT50W|{&NOTEXT:}
MLM.w|423,139
$$TXT={DN_LALT},{NUM_1},{NUM_4},{NUM_4},{UP_LALT}
SKI.$$TXT
ENR.
SKI.$$TXT
SKI.Hallo,64,{ENTER}
Remarks
For easier Typing without Commas between Elements you can also try SKP. or SKT.
Limitations:
SKI. works on the lowest Level that the robot can reach. If there are windows which you can not type in, please make sure that you have Admin-Rights for the Robot-Executable/SPRE.
' This will not work, as SKP. internally will undo the Effects of SEK.
SEK.LALT|1
SKP.{NUM_1}{NUM_4}{NUM_4}
SEK.LALT|0
' This will work, as KYD. and KYU. are specially made for this.
KYD.{LALT}
KYD.{NUM_1}
PAU..1
KYU.{NUM_1}
PAU..1
KYD.{NUM_4}
PAU..1
KYU.{NUM_4}
PAU..1
KYD.{NUM_4}
PAU..1
KYU.{NUM_4}
KYU.{LALT}
' OR USE
' This will also work
SEK.LALT|1
SKI.{NUM_1},{NUM_4},{NUM_4}
SEK.LALT|0
See also:
• 1.9.1.6 Edit-Textbox Control
• RST. - Replace Selected Text