beautypg.com

Menu commands, Modifying the commands menu – Adobe Extending Dreamweaver CS4 User Manual

Page 157

background image

151

EXTENDING DREAMWEAVER CS4

Menus and menu commands

Menu commands

Menu commands make menus more flexible and dynamic. Menu commands can perform almost any edit to the
current document, other open documents, or any HTML document on a local hard drive.

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 to sort a table and by which column. The head section of a menu commands file contains JavaScript
functions. The functions process form input from the body section and control the edits to the document of the user.

Menu commands are stored in the Configuration/Menus folder inside the Dreamweaver application folder.

Note: Commands on Mac OS X 10.3 are stored in youUser/Library/Application Support/Adobe/Dreamweaver
9/Commands/yourcommandname.html.

The following table lists the files you use to create a menu command.

Note: If you add custom menu commands to Dreamweaver, add them at the top level of the Menus folder or create a
subfolder. The MM folder 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 commands

” on page 148.

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.

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 don’t appear on this list and can’t 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.

Path

File

Description

Configuration/Menus/

menus.xml

Contains a structured list of menu bars, menus,
menu commands, separators, shortcut lists, and
keyboard shortcuts. Modify this file to add new
menus and menu commands.

Configuration/Menus/

commandname.htm

Contains the functions required by the menu
command.

This manual is related to the following products: