This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.
This version is copyright and may only be used for local testing purposes. It may not be distributed.
Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.
Description
Send text to the current top-level window simulating keyboard keystrokes.
Syntax
n = SendString(TextToSend [, mSec_Char [, mSec_Final]])
Returns
Number
Parameters
Name |
Type |
Optional |
Meaning |
TextToSend |
String |
No |
Text to send |
mSec_Char |
Number |
Yes |
Milliseconds to wait after each key text has been sent. |
mSec_Final |
Number |
Yes |
Milliseconds to wait at the end before control is passed back to script |
Remarks
Special keys can be emulated using the following special codes. Note that pressing and releasing special keys is something the programmer must handle.
"{CTRL_DOWN}"
"{CTRL_UP}"
"{ALT_DOWN}"
"{ALT_UP}"
"{SHIFT_DOWN}"
"{SHIFT_UP}"
"{WIN_DOWN}"
"{WIN_UP}"
"{BACKSPACE}", "{BS}"
"{ENTER}", "{ENT}"
"{INSERT}", "{INS}"
"{DELETE}", "{DEL}"
"{RIGHT}", "{ARROWRIGHT}"
"{LEFT}", "{ARROWLEFT}"
"{UP}", "{ARROWUP}"
"{DOWN"}, "{ARROWDOWN}"
"{HOME}"
"{END}"
"{TAB}"
"{ESCAPE}", "{ESC}"
"{PGUP}"
"{PGDN}"
"{F1}"
"{F2}"
"{F3}"
"{F4}"
"{F5}"
"{F6}"
"{F7}"
"{F8}"
"{F9}"
"{F10}"
"{F11}"
"{F12}"
"{F13}"
"{F14}"
"{F15}"
"{F16}"
"{APPS}"
"{NUMLOCK}"
"{PRTSC}"
"{SCROLLLOCK}"
"{HELP}"
"{CAPITAL}"
Restrictions
See also
Examples
Uses "UI"
Dim hWnd As Long
hWnd = Win_FindByTitle("...Notepad")
'---If found ...
If hWnd Then
Sleep 1000
Win_SetForeground(hWnd)
Sleep 1000
SendString "aaaaaaaaa bbbbbbbbbbb bbbbbbbbbb", 0, 1000
SendString "{SHIFT_DOWN}{CTRL_DOWN}{LEFT}{LEFT}{LEFT}{SHIFT_UP}{CTRL_UP}{DEL}", 500, 1000
hWnd = Win_FindByTitle("thinAir...")
Win_SetForeground(hWnd)
End If
Beep