The HoTMetaL PRO scripting interface

The HoTMetaL PRO scripting interface provides access to HoTMetaL PRO via an object model based largely on the Document Object Model (DOM) and the Microsoft Word VBA model.

There are several ways to run scripts in HoTMetaL PRO:

You can use any scripting language that conforms to the Microsoft Scripting Language Interface. Built-in support is provided for JScript and VBScript; this manual provides extensive documentation and examples for these two languages. The scripting language is often a special version of a language: for example, instead of using Perl, you need to use PerlScript (available from http://www.activestate.com) and for Python you need the win32com package. You must specify the language ID in macros and in the Customization editor. This is the ProgId of the ActiveX control that implements the script engine, and can be found in the registry.

Scripts inserted in a macro, dragged-and-dropped, or pasted must begin with the appropriate language comment string.

For VBScript the language comment string is:

' SoftQuad Script Language VBScript:

For JScript it is:

// SoftQuad Script Language JScript:

For an arbitrary language (for which a script engine must be installed) the string optionally starts with the a delimiter (the best choice is the comment character(s) used by the language), followed by the following string, exactly as indicated (but with <progid> replaced by the correct language ID):

SoftQuad Script Language <progid>: 

For example:

# SoftQuad Script Language PERLSCRIPT: 
# SoftQuad Script Language Python: 

The total length of the language comment string must be less than 128 characters.

If you include the language comment string in a macro (which is not required), the starting delimiter must be the language's comment delimiter.

To check whether you have the script engine correctly installed for languages other than JScript and VBScript, write a simple script such as:

# SoftQuad Script Language PERLSCRIPT:
$Selection->TypeText("Hello from Perl");

Copy the script, put the insertion point anywhere the in the HoTMetaL PRO document window that text is allowed, and then paste the script. If only the string in quotes is pasted, the scripting engine is working.


Right arrow
Next Topic
Left arrow
Previous Topic
Table of contents
Table of Contents

Copyright © SoftQuad Software Inc. 1999