Skip to main content

Type in background

Type text and keys such as {ENTER} or {TAB} into a window without bringing it to the front or using the keyboard, so it works while the window is behind others or minimised and the person keeps working.

Command in the Window toolkit · id ooa.window/type_in_background · 9 inputs (1 required), 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
TitleStringNoText in the window title, a pattern with * or ? (e.g. Invoice*- Excel), or re: and a regular expression; case-insensitive. The first visible window that matches is used. May be empty when process_id is given.
TextAnyYesText to type; {ENTER}, {TAB}, {BACKSPACE}, {DELETE}, {ESC}, arrows, {HOME}, {END}, {F1}-{F12} press those keys ({TAB 3} three times; a { inside braces types a {). A Credential is typed without being logged.
Control classStringNoWindow class of the control to type into, or a pattern with * and ?; the window's focused control when empty.
Control indexNumberNo0Which control of that class (0 is the first).
MethodStringNotypetype sends each character and key to the control; replace sets the control's whole text (edit boxes); append adds the text at the end of it.
Delay (milliseconds)NumberNo0Pause after each character or key, for programs that read input slowly.
AlternativesDictionaryNoFallbacks when no title matches: title_pattern (wildcards or re:), class_name, process_name, and index (with class_name). The one that works is logged.
Timeout (seconds)NumberNo0Wait up to this many seconds for the window to appear; 0 looks once.
Process IDNumberNoProcess id from Start program: use that program's main window instead of finding it by title; title, when given, then only narrows the choice.

Outputs​

OutputTypeWhat it is
control_classStringClass of the control typed into, e.g. Edit.
control_textStringThe control's text afterwards, when it reports one (edit boxes do), to check the result.