• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Moving on Down the Road: Int... > Running a Command from an Object

Running a Command from an Object

You’ve made a History command or maybe even a command of your very own, but wouldn’t it be nice if it could have its own little icon on the Insert bar? All you need to know is the filename of the command file in the Commands folder and you can make an object that calls a command.

1.
Open the Insertbar.xml file found in your user configuration Objects folder. (See the “Multiusers Equals Multiple Files” tip earlier in this chapter for more details.)

2.
Locate the category where you want the new object to appear.

3.
Add this code and be sure to change each attribute’s placeholder value appropriately:

<button
command="dw.runCommand('My Command File Name Here.htm',null);"
enabled=""
id="SomethingTotallyUnique"
image="theCategory\MyImageName.jpg"
name="This Is The Tool Tip Text For The Object" />

An example of a button that calls the Add/Remove Netscape Resize fix is as follows:

<button
command="dw.runCommand('Add Remove NS Resize Fix.htm',null);"
enabled=""
id="killerTips_Add_Remove_NS_Resize_Fix"
image="Common\resizeFix.jpg"
name="Add\Remove NS Resize Fix" />

A unique ID is required, and you need an 18×18-pixel image stored in the location specified by the image attribute.

4.
Save the Insertbar.xml file, and then restart Dreamweaver.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint