User Guide

154 Chapter 8: Menus and Menu Commands
Menu Commands
Menu commands make menus more flexible and dynamic. As with regular commands, menu
commands can perform almost any kind of edit to the current document, other open documents,
or any HTML document on a local drive. The Menu Commands API expands the regular
Commands API to accomplish several tasks that are related to displaying and calling the
command from the menu system.
Menu commands are HTML files that are referenced in the
file attribute of a menuitem tag in
the menus.xml file. The
BODY section of a Menu Commands file can contain an HTML form that
accepts options for the command (for example, how a table should be sorted and by which
column). The
HEAD section of a Menu Commands file contains JavaScript functions that process
form input from the
BODY section and control the edits to the users document.
Menu commands are stored in the Configuration/Menus folder inside the Dreamweaver
application folder.
Note: If you add custom menu commands to Dreamweaver, add them at the top level of the Menus
folder or create a subfolder. The Macromedia folder MM is reserved for the menu commands that
come with Dreamweaver.
Modifying the Commands menu
You can add certain kinds of commands to the Commands menu, and change their names,
without editing the menus.xml file. For more information about menus.xml, see “Changing
menus and menu items” on page 151.
Note: The term “command” has two meanings in Dreamweaver. Strictly speaking, a command is a
particular kind of extension. In some contexts, however, “command” is used interchangeably with
“menu item” to mean any item that appears in a Dreamweaver menu, no matter what it does or how
it’s implemented.
To create new commands that are automatically placed in the Commands menu, use the History
panel. Alternatively, you can use the Extension Manager to install new extensions, including
commands. For more information, see Dreamweaver Help.
To reorder the items in the Commands menu, or to move items between menus, you must edit
the menus.xml file.
To rename a command you’ve created:
1 Select Commands > Edit Command List.
A dialog box appears, listing all the commands whose names you can change. (Commands
that are in the default Commands menu dont appear on this list and cant be edited using
this approach.)
2 Select a command to rename.
3 Enter a new name for it.
4 Click Close.
The command is renamed in the Commands menu.