PreFab...Player...Documentation...Frontier...User's Guide...

Chapter 6, Constants

Misc. Constants, Modifier Keys, Special Keys, Attributes


In addition to verbs, Player defines many "nouns" or constants. (A constant is sort of like a variable that doesn't vary, i.e. whose value remains fixed rather than changing or being changed by a script.)

Player's constants can be divided up into 4 categories:
- Misc. Constants
- Modifier Keys
- Special Keys
- Properties

Each category is described on a separate page for easy reference.



Misc. Constants

As an alternative to the screenCoordinates verb, Player provides a screenCoords constant (abbreviated to prevent a conflict).

To make it easy to set the mouse or typing delay back to the default, Player includes defaultMouseDelay and defaultTypingDelay.

For the new disableUserInput verb, Player 1.5 includes mouseOnly and keyboardOnly.

Note: the "checked" constant is obsolete in Player 1.1 and later since all constants have been moved to the top-level of the table where there's already a "checked" attribute with a different value.

Examples

with Player   « ", constants" was required in 1.0x but is optional in 1.1 and later
   clickMouse( {4, 27, screenCoords} )   « abbreviated to prevent conflict with verb

with Player
   clickMouse( {4, 27, 1} )     « screenCoords' value is 1
   clickMouse( Player.screenCoordinates( {4, 27} ) )     « the verb form


with Player   « ", options" was required in 1.0x but is optional in 1.1 and later
   setMouseDelay(defaultMouseDelay)     « reset
   setTypingDelay(defaultTypingDelay)     « reset


with Player   « new in 1.5
   disableUserInput(keyboardOnly)     « allow mouse activity
   ...
   enableUserInput()     « back to normal

Notes




Modifier Keys

"Modifier keys are those that alter the way other keystrokes are interpreted. These keys sometimes affect the way the mouse-button actions are interpreted as well. They are the Shift, Caps Lock, Option, Command, and Control keys." Macintosh Human Interface Guidelines , p. 278

One or more modifier keys can be held down while performing some other action on the Macintosh. Player adds an optional holding parameter to most verbs.

Examples

with Player   « ", modifiers" was required in 1.0x but is optional in 1.1
   typeCombination(command, "a")     « often for Select All
   typeCombination(command + option, "3")     « screen shot
   typeCombination(cmd + opt, "3")     « abbreviations are allowed
   chooseMenu("File", "Print", holding: option)     « send a FAX
   clickMouse( {1,1}, holding: shift )     « select to corner of window

with Player
   typeCombination(option, rightArrow)     « move to end of word
   typeCombination(cmd + opt, rightArrow + downArrow)     « see note

Notes




Special Keys

Many useful keys on the Macintosh keyboard have no real text equivalent. Player lets you specify these keys by name, including alternate names to suit a variety of individual preferences.

List of Supported Keys

standard
lspaceKey, tabKey, returnKey, enterKey, escapeKey, deleteKey
arrows
leftArrow, rightArrow, upArrow, downArrow
misc.
help, forwardDelete, home, end, pageUpKey, pageDownKey
function
F1 ... F15
keypad
keypadPlus, keypadMinus, keypadTimes, keypadDivide, keypadEquals, keypadDecimal, keypad0 ... keypad9

Examples

with Player   « ", keys" was required in 1.0x but is optional in 1.1
   typeKeys(deleteKey)
   typeKeys(F1 + pageUpKey + downArrow + downArrow)     « many keys
   typeKeys("One" + downArrow + "Two")     « mix keys & text
   typeText("One" + downArrow + "Two")     « ... using either verb

with Player
   typeCombination(command, rightArrow)
   typeCombination(cmd + opt, rightArrow + downArrow)     « see note

Notes




Attributes

Player's query verbs provide useful information about an object. Many attributes are common to all objects, others are specific to certain kinds. Because these attributes pertain to objects in other applications, they are all "read-only" and their values cannot be changed.

List of Attributes

Dialog and window items share 5 basic properties: kind, location, height, width, bounds. Each kind has the following additional properties.

Button
name, visible, enabled
Radio Button
name, visible, enabled, value
Checkbox
name, visible, enabled, value
Pop-up Menu
name, visible, enabled
Scroll Bar
name, visible, enabled, value, minimum, maximum
Custom Control
name, visible, enabled, value, minimum, maximum
Text Entry Box
item text
Static Text
item text
Icon
[just the 5 basic]
Picture
[just the 5 basic]
User Item
[just the 5 basic]

Menus have fewer properties:

Menu
name, kind, enabled, quantity
Submenu
name, kind, enabled, quantity
Menu Item
name, kind, enabled, checked, mark

Independent of kind, windows or dialogs have the following properties:

any
name, kind, active, visible, location, height, width, bounds

Examples

with Player   « ", attributes" was required in 1.0x but is optional in 1.1
   getItemAttribute(14, kind)
   getMenuAttribute(checked, "Font", "Geneva")
   getWindowAttribute("Untitled", height)

Notes

Attribute Descriptions

active: whether or not a window is active (frontmost)
bounds: rectangle coordinates (top, left, bottom, right)
checked: whether or not a menu item is checked
enabled: whether or not an item is enabled
height: height in pixels
item text: text contents
kind: the kind of item
location: XY coordinates of upper left corner
mark: the kind of mark on a menu item
maximum: maximum value (for a control)
minimum: minimum value (for a control)
name: item name
quantity: number of items
value: item value
visible: whether or not item is visible
width: width in pixels

| Top |


Chapter 5, Verbs| Prev | Home | Next |Appendix 1, Questions & Answers

Updated on 1/24/99 by Scott S. Lawton (ssl@prefab.com)

Copyright 1993-99, PreFab Software, Inc. All Rights Reserved.

This site built and maintained using Stage Three, a set of custom Frontier scripts.