You are here: Scripting Techniques > What are Scripts? > Scripts Access the Doc-To-Help Object Model

Scripts Access the Doc-To-Help Object Model

Since scripts are subroutines without arguments, your code must communicate with the Doc-To-Help objects. Whenever a script runs, there is always one default global object named Project. The term global means that the object is accessible to all scripts. The term default means that you do not have to refer to it explicitly by name. That is, the following statements are equivalent:

Project.Print "The current Help target is " & Project.Platform

Print "The current Help target is " & Target

The Project object has three collections that represent the individual items in a project. The most important of these are the following:

Topics

All topics in the project.

Keywords

All top-level index keywords in the project.

Groups

All named topic groups in the project.

In addition to its collections, the Project object also has two fundamental properties, each of which returns an object that is central to the compilation process:

ActiveTopic

Returns a Topic object representing paragraph style formatting. This property can be used only in scripts assigned to a paragraph style.

ActiveLink

Returns a Link object representing character style formatting. This property can be used only in scripts assigned to a character style.