FANDOM


Simulates typing on the keyboard.Syntax:

type <string> [with <key> [, <key> [, <key> ]]]

Examples:

type "ABC"
type field "output"
type allKeyboardKeys with shiftKey,optionKey

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.

To type text into a field, you must first place the insertion point in the field using the select or click command.

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.

Parameters:

  • string (string):
  • key:One of commandKey, controlKey, optionKey, or shiftKey. You can specifyup to three keys, separated by commas. (On Windows and Unix systems,commandKey indicates the Control key.)

See also: rawKeyUp (message),keyDown (message),rawKeyDown (message),keyUp (message),stack (object),typingRate (property),blindTyping (property),