home / experts / javascript / column56 |
|
Assigning Macros to ButtonsHoTMetaL supports scripting through macros. Macros can be invoked by toolbar buttons and other means that we'll show you later in this column. All HoTMetal's macros should be stored in a single file, One of the ways to run a macro is to create a toolbar button and associate a macro with it. Clicking the button triggers the execution of the script defined in the macro. When you select Toolbars from the View menu, you get the following tabbed dialog box:
The first tab lets you add, delete, and manipulate toolbars. Since we don't want to change any toolbar, this tab will not be useful for us right now. Click on the Buttons tab. Select the Application Macros category. Notice that new text boxes appear on the right hand side of the form:
The first macro on the list is
Pick the yellow Smiley image and you will arrive at the following:
Now drag the Smiley icon to the Standard toolbar, or any other toolbar. Close the Toolbar and Menu Customization dialog box. The new button will now be visible on the Standard toolbar, or any other toolbar you have chosen to add the button to. You can find out the toolbar names by turning them on and off from the Toolbar and Menu Customization dialog box (invoked by choosing the Toolbars option from the View menu). Here is how the extended Standard toolbar looks like:
Let's try the macro now. Open an HTML file. The file |
Produced by Yehuda Shiran and Tomer Shiran
Created: January 18, 2000
Revised: January 18, 2000
URL: http://www.webreference.com/js/column56/buttons.html