Every script has access to four globally
defined objects. These are Application, ActiveDocument,
Documents and Selection. These objects are instances of
the general interfaces Application, Document,
Documents, and Selection
respectively.
-
The Application object represents the
currently running instance of HoTMetaL PRO.
-
The
ActiveDocument object is a Document object that always
represents the active document (the document in the active window). If
ActiveDocument is assigned to a variable, the value of the variable will
change if a different document becomes the active document. See also Application.ActiveDocument.
-
The
Documents object is a collection of Document objects. It
represents all of the currently open HoTMetaL PRO documents.
-
The Selection object always represents the user's
current selection. This object can be accessed as Selection or
Application.Selection.
-
By contrast with
Selection, a Range object (an instance of the
Range interface)
represents a selection that does not have to be the user's current selection. The selection
represented by a Range can be in the same document as the user's selection, or
in a different document. A Range object provides all the properties and
methods of the Selection interface, along with with two additional methods.
Methods that modify the document structure (for example, inserting an element) should normally be
used with Range objects, rather than selection objects, since selections can
be placed in a smaller set of locations in the document.
Copyright © SoftQuad Software Inc. 1999