Specifications

Chapter 768
5 Dreamweaver calls the receiveArguments() function, if defined, in the selected Menu
Commands file to let the command process any arguments that are passed from the menu item.
Note: If it is a dynamic menu item, the ID of the menu item is passed as the only argument.
6 Dreamweaver calls the commandButtons() function, if defined, to determine which buttons
appear on the right side of the Options dialog box and what code should execute when the user
clicks the buttons.
7 Dreamweaver scans the Menu Commands file for a FORM tag.
If a form exists, Dreamweaver calls the
windowDimensions() function to determine the size of
the Options dialog box that contains the BODY elements of the file.
If
windowDimensions() is not defined, Dreamweaver automatically sizes the dialog box.
8 If the Menu Commands files BODY tag contains an onLoad handler, Dreamweaver executes the
associated code (whether or not a dialog box appears). If no dialog box appears, the remaining
steps do not occur.
9 The user selects options in the dialog box. Dreamweaver executes event handlers that are
associated with the fields as the user encounters them.
10 The user clicks one of the buttons that are defined by commandButtons().
11 Dreamweaver executes the code that is associated with the clicked button.
12 The dialog box remains visible until one of the scripts in the Menu Commands calls
window.close().
The Menu Commands API
The custom functions in the Menu Commands API are not required.
canAcceptCommand()
Description
Determines whether the menu item should be active or dimmed.
Arguments
{arg1}, {arg2},...{argN}}
If it is a dynamic menu item, the unique ID given in getDynamicContents() is the only
argument. Otherwise, if the
arguments attribute is defined for a menuitem tag, the value of that
attribute passes to the
canAcceptCommand() function (and to the “isCommandChecked()” on
page 70
, “receiveArguments()” on page 70, and “setMenuText()” on page 71 functions)
as one or more arguments. The
arguments attribute is useful for distinguishing between two
menu items that call the same menu command.
Note: The arguments attribute is ignored for dynamic menu items.
Returns
Dreamweaver expects a Boolean value that indicates whether the item should be enabled.