User Guide
144 Chapter 7: Commands
Finally, changeCase() resets the selection and calls window.close() to close the UI. The code
looks like the following example:
// Set the selection back to where it was when you
// started
theDOM.setSelection(theSel[0],theSel[1]);
window.close(); // close extension UI
}
Running the command
After you place the files in the Commands folder, you must either restart Dreamweaver or reload
the extensions before the new extension appears on the Commands menu.
To make Dreamweaver reload extensions, hold down the Control key (Windows) or the Options
key (Macintosh) and click the current category button on the Insert bar, as shown in the
following figure:
Next, click the Reload Extensions item on the Context menu, as shown in the following figure:
The Change Case entry should now appear on the Commands menu.
When Dreamweaver starts, it creates a Commands menu entry for each HTML file in the
Commands folder, except those that contain the following line:
<!-- MENU-LOCATION=NONE -->
Because the Change Case.html file does not contain this line, Dreamweaver adds an entry for
Change Case to the Commands menu. The entry will be dim, however, until the user selects text
in the document.
To test the command, type some text in a document, select it, and select Change Case from the
Commands menu.