Simulates typing on the keyboard.
# Metadata
Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:
# Syntax
type string [with key [, key [, key ]]]
# Params
- string : - key : One of commandKey, controlKey, optionKey, or shiftKey. You can specify up to three keys, separated by commas. (On Windows and Unix systems, commandKey indicates the Control key.)
# Examples
type "ABC"
type field "output"
type allKeyboardKeys with shiftKey,optionKey
# Description
Use the type command to show text appearing in a field at typing pace or to send keyboard events to a stack.
The type command sends a rawKeyDown and rawKeyUp message to the current card for each character typed.
The type command does not automatically place an insertion point in a field, so if you want to simulate typing into a field, you must first use the select command to place the insertion point:
select after field "Data" type "Hello"
The speed at which characters are typed is controlled by the typingRate property. To quickly put text into a field without delay, use the put command instead.
>*Note:* To type text into a field, you must first place the > insertion point in the field using the select or click > command.
>*Note:* As the type command is designed to emulate exactly what > happens when a user types a key on the keyboard, the rawKeyDown, > keyDown, rawKeyUp and keyUp messages are sent by the command. If > these messages are blocked, the text will not appear in the selected > field.
# Tags
ui,
# See
- **keyword:** field, character - **property:** typingRate, blindTyping - **message:** rawKeyUp, keyDown, rawKeyDown, keyUp - **command:** put, select, click - **object:** stack - **glossary:** property, current card, insertion point, command, event