Player
Documentation
AppleScript
User's Guide
Chapter 5, Verbs
One Verb Per Page
do menu: choose from a pop-up menu
Syntax
do menu popup item nameOrPosition of popup namePositionOrLocation [of submenu nameOrPosition] [holding modifierKeys] [extra click true/false]
Parameters
popup item nameOrPosition -- name or position number (counting menu dividers) of the pop-up item
of popup namePositionOrLocation -- name, ID number, or location (an {x, y} list) of the pop-up menu
[of submenu nameOrPosition] -- name or position number (counting menu dividers) of the submenu
[holding modifierKeys] -- one or more modifier keys (command, shift, option, control, caps lock), concatenated with "&"
[extra click true/false] -- set to 'false' to disable the extra click (for a slight increase in speed but at the risk of the app not noticing the changed popup value)
Result
true
Examples
do menu popup item "Text" of popup "File Format"
do menu popup item "Plain Text" of popup 13 -- format (in MORE)
do menu popup item "points" of popup {220, 147} -- height
do menu popup item "Text" of popup "File Format" without extra click -- new in 1.5
Notes
- Many pop-ups cannot by identified by name. These are often implemented as "user items" rather than true pop-ups. Use Player's balloon help to determine the ID number (if any) and location.
- As shown in the example, even if the popup itself must be specified by XY location, the item can usually be specified by name.
- You can make a script a little faster by setting "extra click" to false. (AppleScript converts this to "without extra click".) Unfortunately, it won't work in all cases. Even though the popup visibly changes, some applications don't notice the change without the extra click.
- By default, Player matches only the number of characters specified in the verb parameter. This feature has the benefit of ignoring trailing punctuation, but will occasionally find a false match.
- By default, name matching is not case sensitive.
- For nested hierarchical menus, use the form "submenu;subsubmenu".
Errors
menu or item does not exist or is not enabled
See Also
exists popup
get info popup
set complete match
click button
Copyright 1993-99, PreFab Software, Inc. All Rights Reserved.
This site built and maintained using Stage Three, a set of custom Frontier scripts.