<< Click to Display Table of Contents >> Navigation: 1. Starting Guides > 1.9.1 Types of controls > 1. Starting Guide |
Starting Guide
Edit- or Textbox Control
What controls do we have to do with?
The control we're focusing on now is the Textbox Control, also known as an "Edit Control".
There are two primary methods for inputting text into the Edit Control:
• Simulating Keyboard Typing (compatible engine)
• Directly Setting the Text of the Control (direct engine)
Typically, we favor the direct engine for its numerous advantages in automated installations.
It's faster, more reliable, and functions even if the user isn't logged into the machine. The commands for the direct engine setting a textbox are:
• SDT. - SenD-window-Text (direct engine)
• RST. - Replace Selected Text (direct engine)
Here's a script that sets a textbox using the direct engine:
VAR.$$S00=?progs\UltraVNC
STW.wct|45|TWizardForm|Setup - UltraVNC
SCW.wcd|45|TEdit|5
RST.$$S00|0,-1
In some cases, depending on the target control, the direct engine might be ignored by the control. If this occurs, you'll need to use the compatible engine instead. The compatible engine simulates key presses like a human user and therefore can't be easily ignored by an application. For example, if you want to type text into a web browser, you'll need to use the compatible engine.
The most used compatible engine commands for setting a textbox are:
• SKP. Send-Key-Press (compatible engine)
• SKT. - Send-Key-Text (compatible engine)
Note that there are much more then these two.
Most Edit Controls have "edit" or "text" in their class name. However, as window classes can be named at the programmer's discretion, the window class for an Edit Control can vary.
Here's how a windows inspector would display a Edit-Control:
There's a wide variety of Edit Controls beyond the two we've discussed. Most Edit Controls have "edit" or "text" in their class name. However, as window classes can be named at the programmer's discretion, the window class for an Edit Control can vary. Here's how a windows inspector would display an Edit Control:
It's important to note that text-boxes in a browser window, like the one shown below, are not traditional windows controls. They aren't genuine text-boxes and can only be accessed using compatible engine commands. This also applies to buttons and other web-based controls.
In such cases, you should use the Acc-Inspector instead. Utilize the SAO., MOS., and compatible engine commands. Here's a script to get you started with web-based controls:
' Script to type into a WEB-based text-box using the
' compatible engine
' Check if the Internet-Explorer is already running
STW.wXgct|0|over|IEFrame|Theo Gottwald&ANDTHEN:Internet Explorer
' If its not running start it with the right starting page
EXO.iexplore|www.fa2.de
' If it was just started, locate the application window
STW.ct|IEFrame|Theo Gottwald&ANDTHEN:- Windows Internet Explorer
' This label is where we land, if the window is already o
:over
' We set the position of the IE-Window to the upper, left corner (0,0)
' And set the size of the window to 827,700
SWP.0,0|827,700
' We locate the web-control that contains the web-page
SCW.ct|Internet Explorer_Server|{&NOTEXT:}
' we remember the handle of the web-control in a variable
HTV.$$MYW
' Locate the web-based text-box
SAO.rn|42|{&NOTEXT}
' Klick inside
MLI.
' Type the text
SKT.info@it-berater.org
' Wait because typing is asynchrone
PAU.0.5
' Locate the web-control that contains the web-page
' we use the handle that we have remembered
SCW.h|$$MYW
' Locate the web-based button
SAO.rn|43|Google Search
' Click the Search button
MLE.
ENR.
See also:
• SKP. Send-Key-Press (compatible engine)
• SKT. - Send-Key-Text (compatible engine)
• SDT. - SenD-window-Text (direct engine)
• RST. - Replace Selected Text (direct engine)