SEND <"Text to send">
Evaluate and send Keystrokes to the Current Destination window. You must enclose the keystrokes to be sent with "". Any character that can be typed is supported.
How to Send SHIFT, ALT, CTRL key combinations
To send combination of keys such as Shift+F, Ctrl+F, Alt+F, precede the key character with the one of following modifier characters:
@ Alt
~ Shift
^ Ctrl
Example:
'-- Send ALT-F
SEND "@f"
'-- Send ALT-F then X
SEND "@fx"
'-- Send CTRL-ALT-F5
SEND "^@{F5}"
Note: Surround sequences of characters or key names with parentheses in order to modify them as a group. For example, '~abc' shifts only 'a', while '~(abc)' shifts all three characters.
( = Begin modifier group
) = End modifier group
Example:
'-- the script below will type "John Doe"
SEND "~john ~doe{enter}"
'-- the script below will type "JOHN DOE" (all uppercase)
SEND "~(john) ~(doe){enter}"
How to Send Special Keystrokes
You can also send the special keystrokes to an application by surrounding them with {}.
{ = Begin key name text
} = End key name text
The special keystrokes are as follows:
{F1}
{F2}
...
{F12}
{BACKSPACE}
{DELETE}
{DOWN}
{END}
{ENTER}
{ESCAPE}
{HOME}
{INS}
{LEFT}
{PGDN}
{PGUP}
{RIGHT}
{SHIFT}
{SPACE}
{TAB}
{UP}
Note: Follow the keyname with a space and a number to send the specified key a given number of times (e.g., {left 6}).
Example:
'-- Send ALT-F1
SEND "@{f1}"
'-- Send CTRL-ALT-F5
SEND "^@{F5}"
More Examples:
'-- Start notepad
EXECUTE "c:\windows\notepad"
'-- Wait for Notepad window for 10 seconds
FOCUS("Untitled - Notepad", 10, 0)
'-- send out the keystrokes
SEND "Hello World.{ENTER}"
How to Send ( ) { } ~ @ ^ as a part of the text
Surround the modifier keys listed above with braces ( {} ) if you want to send those key as normal text. This also applies to ( ) { }.
Example:
'-- This will type out @ ~ ^
SEND "{~} {@} {^}"
'-- This will type out ( ) { }
SEND "{(} {)} {{} {}}"
How to send variable as a part of the text
You can make a reference to a variable within the <Text to send> by appending + after the variable.
Example:
'-- Ask a user for a customer name and store the answer in CustName
INPUT "Your Name?", YourName
'-- Send the name out to a window
SEND "Your Name is " + YourName + "{ENTER}"
See Also