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).

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 and also shows menu actions defined by plug-ins. 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 2,066 found items is computer-dependent; see the Notes section, below, for details). The columns are resizable; if you don't see the ID column, resize the first to columns to bring the third column into view.

Menu actions dialog

Notes

The list can be filtered and sorted in several ways. 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 list items that start with 'Tab', enter ^Tab. To search whole-word only, add \b before and after: \b[Tt]ab\b.)

Area filters by area. This corresponds with the top-level menus (File, Edit, etc.), panels, scripts, and various other items. 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 (the options are by Name, Area, and ID).

menu actions filtered

To display any keystrings for the selected menu action, click 'Show keystring' button. Not all menu actions have a keystring, some have more than one:

A keystring

The window is resizable and you can copy text out of it.

Keystrings are useful for making scripts language-independent.

Notes

– The number of actions printed in the dialog's frame is different on each computer. Plug-in actions 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, open the script in a plain-text editor and change line 12 as follows:

var hideJunk = false;

– 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.

– And, finally, yet another bug in ScriptUI prevents the correct sizing of the column widths. When the script starts, the ID column is hidden, you'll have to resize the columns manually. This can be done in the usual way by making the header cells narrower.

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

8 Jan. 2023: Changed the alert that lists key strings so that text can be copied out of it.

30 Oct. 2021: It was pointed out to me that if an action name occurred more than once (in different areas), only one instance was shown. That's fixed (Thanks to Jeremy Howard). Reviewing the code led to various rewrites that made the script more efficient.

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

26 August 2012: First posted.


Useful script? Saved you lots of time?

Consider making a donation. To make a donation, please press the button below. This is Paypal's payment system; you don't need a Paypal account to use it: you can use several types/brands of credit and debit card.

Peter Kahrel's paypal account

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

Back to script index

Installing and running scripts

Questions, comments? Get in touch