HotMetalPro Macros

by Richard A. DeVenezia, Back to Home

Alas, SoftQuad is now defunct and it's technology whisked off to the bowels of Corel. Regardless, HotMetalPro is still an easy to use and intuitive HTML page and site editor.

I developed these macros for use in HMP.

The macros should be placed in the macros/hotmetal.mcr file beneath your HMP installation folder.


Version 6 Update 4

The fourth and final update for HotMetalPro 6.0 was an upgrade to version 6.0.3.164. The release date was around May 7, 2001.


Insert Updated Line

This macro inserts a line of text at the bottom of a page indicating when the page was last edited.

<MACRO name="Insert Updated Line" lang="JScript" id="12" key="Ctrl+Alt+Shift+D"><![CDATA[
 var monthName = new Array(
 "January","February","March",
 "April","May","June",
 "July","August","September",
 "October","November","December");

 var s = "This page was last updated";
 var d = new Date();
 var r = ActiveDocument.Range;

 r.MoveToDocumentEnd();

 r.MoveToElement("BODY");
 r.PasteString("");
 r.MoveLeft();

 r.PasteString (
  "<ADDRESS>"
  + s + " "
  + d.getDate() + " "
  + monthName[d.getMonth()] + " "
  + d.getYear() + "."
  + "</ADDRESS>"
  );
]]></MACRO>

On_Before_Document_Save

This macro updates the line inserted by Insert Updated Line whenever a document is saved.

<MACRO name="On_Before_Document_Save" lang="JScript" id="158" key="Ctrl+Alt+Shift+S"><![CDATA[
 var monthName = new Array(
 "January","February","March",
 "April","May","June",
 "July","August","September",
 "October","November","December");

 var s = "This page was last updated";
 var r = ActiveDocument.Range;
 var prevSaved = r.Find.Execute(s+".*\\.","","",false,false,true);

 if (prevSaved) {
   var d = new Date();
   r.PasteString ( s + " "
   + d.getDate() + " "
   + monthName[d.getMonth()] + " "
   + d.getYear() + "." );
 }
]]></MACRO>

This page was last updated 3 June 2003.