The Dreamweaver Application Programming Interface (API) includes two kinds of commands: regular commands and menu commands. The difference between them is subtle and doesn't involve the functionality of what they can do, but of how and where they appear in the Dreamweaver menu system. Regular commands appear in the Commands menu by default, although this default can be overridden by editing the menus.xml file. The menu items representing regular commands are static, meaning that the name and appearance of the menu item does not change based on document context or other conditions.
Figure 5.1 shows some regular commands as they appear in the Commands menu. Menu commands don't appear in the menu system at all by default; their presence in the menu system is determined solely by menus.xml. In addition to this, menu commands have the ability to generate dynamic menu itemsfor instance, the menu item can include a toggling checkmark as a program feature is turned on or off, or the item name might read differently depending on what documents are open or what page elements are selected. Figure 5.2 shows a selection of dynamically generated menu commands in various menus.
Figure 5.1. The Commands menu, showing entries for regular commands.
Figure 5.2. The Window and Edit menus, showing dynamic menu entries generated from menu commands.
In this chapter, we'll start by familiarizing ourselves with the API for regular commands; then we'll examine the added functionality of menu commands.