Menu actions

Recently, I needed the name of the Tabs panel so I could close it before running a script (in CS6, if the Tabs panel is open and you run a script that uses a ScriptUI interface, the script won't respond to the Enter key). There are various scripts around to produce lists of menu actions, their names and IDs, but it's not always easy to find what you want in a list of 2,000+ items (see various links, below). (Why did I not simply try Tabs?)

I thought that a displayed list might be useful, and decided to make life easier for future reference. The advantage of a script over a printed version is that a script gives the correct result in every InDesign version. Furthermore, functionality can be added to filter and sort the list in some ways.

When you run the script linked below, it shows the list with menu actions as follows (the reported number of 1,420 found items is computer-dependent; see the Notes section, below, for details).

Menu actions dialog

The Name field filters actions by name. What you enter there is interpreted as a regular expression, as you can see in the screenshot, below. (Regular expressions are case-sensitive; to do case-insensitive searches, e.g. for Tab and tab, place T and t in square brackets, as in the screen shot. To search whole-word only, add \b before and after: \b[Tt]ab\b.)

Area filters by area. Choose [All] to reset the filter.

ID is not a filter as IDs are unique; rather, entering an ID selects the action in the list. This option is useful if you want to know which menu action is associated with an id – for example, you're reading a script in which a menu action is invoked by its id rather than by its name. IDs are useful because they are language-independent.

At Sort you can choose how the list should be sorted (options are by Name, Area, and ID).

menu actions filtered

Notes

– The number of actions printed in the dialog's frame is different on each computer. Plug-ins are listed as menu actions, and these differ by computer. Installed font family names, font styles, and scripts all count as actions, and these, too, are different on every computer.

Many menu actions can be scripted directly, so there is no need to include them in the list displayed by the script. The script therefore filters out font family names, font styles, and scripts. Document names in the Open Recent menu, the items from the Type > Insert Special Character / White Space / Break Character menus, and everything in the Text Selection menus – all these are filtered out too, because they can be scripted directly, which is easier and probably more efficient. To disable this filter, comment out lines 82, 83, and 90 in the script.

– A bug in ScriptUI prevents the correct display of all area names in the Area dropdown. The names are there, but they're not all displayed; all you see is an empty container. But move the mouse over the empty list and the names are shown.

– Another bug in ScriptUI sometimes causes the list to be redrawn excruciatingly slowly. This doesn't happen often. If it does, the vertical slider hops up and down for a bit before the screen finally redraws.

Links

The best discussion of menu items is Marc Autret's article. A good example of a simple script to produce a printed list and some discussion on how to use menu actions is Kasyan Servetsky's article.

Menu actions have been discussed in Adobe's scripting forum in several threads. Some interesting details can be found here:

http://forums.adobe.com/thread/1041457
http://forums.adobe.com/thread/1027070
http://forums.adobe.com/thread/850636
http://forums.adobe.com/thread/595826


Version history

3 Feb. 2017: Fixed the display problem in CS6/Windows 10.

26 August 2012: First posted.


Show script (right click, Save Link/Target As to download)

Back to script index

Installing and running scripts

Questions, comments? Get in touch