EasyManua.ls Logo

Adobe 0046100128056 - InDesign - Mac - Menus; Understanding the Menu Model

Adobe 0046100128056 - InDesign - Mac
209 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
128
9
Menus
InDesign 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 InDesign 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 already read Adobe InDesign CS5 Scripting Tutorial and know how to create, install, and run
a script.
Understanding the Menu Model
The InDesign 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:
X menuItems — The menu options shown on a menu. This does not include submenus.
X menuSeparators — Lines used to separate menu options on a menu.
X submenus — Menu options that contain further menu choices.
X menuElements — All menuItems, menuSeparators and submenus shown on a menu.
X eventListeners — These respond to user (or script) actions related to a menu.
X 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, InDesign 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:

Table of Contents