SENDKEYS

Usage

TIBCO iProcess Workspace (Windows)

Warning: (iProcess only) This expression is not available to the TIBCO iProcess Script Server Plug-in. Therefore, even though you can successfully enter the expression in your iProcess Script plug-in definition, it will not be processed by the iProcess Engine. It will return SW_NA.

Sends the specified keystrokes to the active window. The active window may be an iProcess window, or another application window.

Syntax

SENDKEYS (keytext)

where keytext is a text string specifying the keys or key combinations to send. Any single key or any key combined with Alt, Ctrl, or Shift may be specified. The maximum number of keystrokes which may be represented by keytext is approximately 80:

Printing keys are specified by the corresponding letter, for example "a".
Non-printing keys are specified by a key code included in keytext; for example "{ENTER}". Valid codes are:

Key

Code

Backspace

"{BACKSPACE}", "{BS}" or "{BKSP}"

Break

"{BREAK}"

Caps Lock

"{CAPSLOCK}"

Clear

"{CLEAR}"

Delete

"{DELETE}" or "{DEL}"

Down Arrow

"{DOWN}"

End

"{END}"

Enter

"{ENTER}" or "~"

Esc

"{ESCAPE}" or "{ESC}"

Help

"{HELP}"

Home

"{HOME}"

Insert

"{INSERT}"

Left Arrow

"{LEFT}"

Page Down

"{PGDN}"

Page Up

"{PGUP}"

Print Screen

"{PRTSC}"

Right Arrow

"{RIGHT}"

Scroll Lock

"{SCROLLLOCK}"

Tab

"{TAB}"

Up Arrow

"{UP}"

F1 to F16

"{F1}" to "{F16}"

Key combinations may be specified by preceding the key or keycode with one or more of the following characters:

To combine with

Use code

Shift

+

Ctrl

^

Alt

%

To use those characters or the bracket characters in their own right enclose them in brackets:

{+} {^} {%} {{} {}}

Invalid key sequences (for example, an unmatched "{") results in no keys being sent.

Any key sequence directed to the Form Window which would result in the window being closed is intercepted. Use the ISWINDOWS function for this purpose. Similarly, attempting to close the Tools window with the SENDKEYS function should be avoided.

Note: With some applications, it may be necessary to split a sequence of keys being sent into more than one SENDKEYS statement. This is to allow time for the application to respond.

Returns

One of the following numeric values:

Value

Description

0

Success

1

Failure (for example, too many keys in keytext argument, or unmatched brace)

Examples

TIBCO iProcess Modeler:

To send the keys "Abc" followed by Enter:

SENDKEYS("Abc{ENTER}") 

To send the contents of the text field NAME:

SENDKEYS(name) 

To send Alt+E followed by C; these keys normally select the application's Edit Copy facility:

SENDKEYS("%ec") 

TIBCO Business Studio:

IPEEnvironmentUtil.SENDKEYS("Abc{ENTER}");
IPEEnvironmentUtil.SENDKEYS("name");
IPEEnvironmentUtil.SENDKEYS("%ec");