Player
Documentation
AppleScript
User's Guide
Chapter 5, Verbs
One Verb Per Page
type: text and special keys
Syntax
type textOrKeys [holding modifierKeys]
Parameters
textOrKeys -- text, a special key, or a list of text and/or keys
[holding modifierKeys] -- one or more modifier keys (command, shift, option, control, caps lock), concatenated with "&"
Result
true
Examples
type "Hello World" -- plain text (including variables)
type "One" & tab & "Two" -- tab is an AppleScript constant
type letterToMom -- a bunch of text (stored in a variable)
type down arrow -- a single key
type {escape, delete, page up, F12, keypad1} -- different types of keys
type {"One", down arrow, "Two"} -- mix text and keys
type "s" holding command -- save
type up arrow holding command & option -- go to summit ("home") in MORE
type {right arrow, right arrow} holding shift -- select text
Notes
- See Special Keys in Chapter 6 for a complete list of keys.
- This verb may type faster than an application can accept keystrokes. Use set typing delay to set a short delay.
- If the "focus" is not set to a place that will accept text, the text will probably just go nowhere harmlessly.
- When typing just text or just keys, or beginning a sequence with a key (not with text), the items can by concatenated with "&" instead of using a list, e.g.:
- type "Hello" & "World"
- type left arrow & down arrow
- type F1 & "any text"
- -- AppleScript does not allow "any text" & F1
- To type special characters that are not on the keyboard, use type and the ASCII character scripting addition that comes with AppleScript, e.g. type ASCII character 29 will enter the "Record Separator" character. (However, character 31 is reserved by Player and cannot be typed.)
Errors
unknown key
See Also
set typing delay
disable user input
Copyright 1993-99, PreFab Software, Inc. All Rights Reserved.
This site built and maintained using Stage Three, a set of custom Frontier scripts.