Method Reference
ControlSend
Sends a string of characters to a control
ControlSend "title", "text", "controlID", "string" [, flag]
Parameters
title | The title of the window to access. |
text | The text of the window to access. |
controlID | The control to interact with. See Controls. |
string | String of characters to send to the control. |
flag | Optional: Changes how "keys" is processed: flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow. flag = 1, keys are sent raw. |
Return Value
Success: | Returns 1. |
Failure: | Returns 0 if window/control is not found. |
Remarks
ControlSend can be quite useful to send capital letters without messing up the state of "Shift."
When using a control name in the Control functions, you need to add a number to the end of the name to indicate which control. For example, if there two controls listed called "MDIClient", you would refer to these as "MDIClient1" and "MDIClient2".
Note, this function cannot send all the characters that the usual Send function can (notably ALT keys) but it can send most of them--even to non-active or hidden windows!
Related
Example
Set oAutoIt = WScript.CreateObject("AutoItX3.Control") oAutoIt.ControlSend "Untitled", "", "Edit1", "This is a line of text in the notepad window"