Adobe 65009333 Scripting Guide - Page 63
Menus, Understanding the menu model
UPC - 883919155852
View all Adobe 65009333 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 63 highlights
6 Menus InCopy scripting can add menu items, remove menu items, perform any menu command, and attach scripts to menu items. This chapter shows how to work with InCopy menu scripting. The sample scripts in this chapter are presented in order of complexity, starting with very simple scripts and building toward more complex operations. We assume you read Chapter 2, "Getting Started" and know how to create, install, and run a script. Understanding the menu model The InCopy menu-scripting model is made up of a series of objects that correspond to the menus you see in the application's user interface, including menus associated with panels as well as those displayed on the main menu bar. A menu object contains the following objects: ➤ menuItems - The menu options shown on a menu. This does not include submenus. ➤ menuSeparators - Lines used to separate menu options on a menu. ➤ submenus - Menu options that contain further menu choices. ➤ menuElements - All menuItems, menuSeparators and submenus shown on a menu. ➤ eventListeners - These respond to user (or script) actions related to a menu. ➤ events - The events triggered by a menu. Every menuItem is connected to a menuAction through the associatedMenuAction property. The properties of the menuAction define what happens when the menu item is chosen. In addition to the menuActions defined by the user interface, InCopy scripters can create their own, scriptMenuActions, which associate a script with a menu selection. A menuAction or scriptMenuAction can be connected to zero, one, or more menuItems. The following diagram shows how the different menu objects relate to each other: 63