|MySQL Conference and Expo April 14-17, 2008, Santa Clara, CA|
Enhancing the editor
Actually, working in Dreamweaver is what gave me the inspiration to write the "Count Your Words" article because I wanted to do a word count while working on an HTML document, but couldn't. So, today I'll explain a bit about Dreamweaver's configuration mechanism, how commands work, and how to implement and incorporate your own word count function. Then you'll be able to count the number of words you've selected or those from the complete document.
What you'll need
To follow the examples, you'll need either Dreamweaver or Dreamweaver Ultradev version 3 or later. Since all configuration files are simple plain text, you can just use Dreamweaver to make the necessary changes. You can download a free 30-day trial version at Macromedia's Dreamweaver download page.
So, let's see what happens internally when you invoke a command by selecting it in the Commands menu?
When you select and open the Commands menu, Dreamweaver reads all the command files that are defined for this menu. The menu and its items are defined in a separate configuration file,
To determine if a command is suitable for a document or its selection, the function
To receive arguments, the function
To create the buttons on the right of the dialogue, the function
In order to become displayed, the HTML document must contain a
In the last step, the functions defined in the document's body
We created an example file for you containing the needed skeleton with all functions of the Commands-API.
Now, let's see how a command is integrated into one of Dreamweaver's menus.