Macromedia RoboHelp - 8.0 Scripting Guide

®
ADOBE® ROBOHELP 8
Scripting Guide
Copyright
© 2009 Adobe Systems Incorporated. All rights reserved. Adobe® RoboHelp® 8 Scripting Guide for Windows®
Adobe, the Adobe logo, Adobe AIR, AIR, FlashHelp, FrameMaker, and RoboHelp are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Windows is either a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries. All other trademarks are the property of their respective owners.
This work is licensed under the Creative Commons Attribution Non-Commercial 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/3.0/us/
Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA.

Contents

Chapter 1: Scripting basics
Scripting support in RoboHelp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
RoboHelp object model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Chapter 2: Classes
RoboHelp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
TokenManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Token . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
TopicManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
MasterPageManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
SnippetManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
UDVManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
FileManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
TOCManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
IndexManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
GlossaryManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
SkinManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
CBTManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
SSLManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
FMFileManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
WordFileManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
ReportManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
ServerManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
MapIdManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
HTMLHelpWindowManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Skin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
CBT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
UDV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
SSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Snippet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Topic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
MasterPage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
TOC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
HTMLHelpWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
FMFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
WordFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
iii
ROBOHELP 8 SCRIPTING GUIDE
Contents
Chapter 3: Constants
Syntax for using constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
SSLLayoutType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
ReportType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
DeleteOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
SkinType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
FrameFileFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
TokenType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
TagType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
FileStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
SyncStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
ServerType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
WordFileFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
HTMLHelpWindowAlign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
HTMLHelpWindowDefaultTab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
HTMLHelpWindowButtons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
HTMLHelpWindowProperties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
iv
Index ................................................................................................................ 93

Chapter 1: Scripting basics

A script is a series of commands that instructs Adobe® RoboHelp® to perform a set of specified actions, such as counting the images used in a RoboHelp project or selecting multiple master pages and importing them. Scripts automate repetitive tasks and are often used as a creative tool to streamline tasks that are time-consuming.
Before you begin scripting, take a few moments to read an overview of the scripting support in RoboHelp and find out how to create and run scripts.
If you are familiar with scripting or programming languages, you can skip this chapter and refer to “Classes” on page 4 and “Constants” on page 83 for information about RoboHelp scripting classes and constants.
If you are new to scripting, you can acquaint yourself with the basic scripting concepts provided in the Introduction
to Scripting manual.

Scripting support in RoboHelp

RoboHelp supports ExtendScript, which is an extended version of JavaScript. As a beginner, the difference between these two languages does not affect you. However, name JavaScript scripts with a .jsx extension, instead of the usual .js extension. ExtendScript files are distinguished by the .jsx extension.
1

Creating scripts

Adobe provides ExtendScript Toolkit (ESTK) with its applications as a scripting utility. The ESTK has many features that make it easier to use than a text editor, including a built-in syntax checker that identifies where the problems are in your script and tries to explain how to fix them, and the ability to run your scripts right from the ESTK without saving the file. This second feature can save you a lot of time, especially in the beginning when you may have to test and edit a script several times to get it to work.
Debug scripts
Select the Adobe RoboHelp 8 option as the target application from the drop-down list in the ESTK.
Edit scripts
Double-click a script file in Script Explorer or Windows Explorer to edit it using the ESTK.

Managing scripts from within RoboHelp

The Script Explorer pod enables you to manage scripts and do any of the following:
Create a script folder Create a folder for storing specific scripts. For example, you can store scripts that record data in
one folder and scripts that display output in another folder.
Reorganize folders You can reorganize folders through simple drag-and-drop operations.
Import and export You can export and import script files and folders in different projects and locations. To import or
export a folder, it must contain at least one script file.
ROBOHELP 8 SCRIPTING GUIDE
Scripting basics

Running scripts

From the command line, enter the following command:
Robohtml.exe -x [scriptfilenames]
You can specify multiple script filenames, separated by a space, to run one script after another. If the filename path contains a space, enclose the filename path in single or double quotation marks.
In RoboHelp, choose Tools > Scripts to run sample scripts or create new scripts and run them.
In Windows Explorer, double-click a script to open it in ExtendScript Toolkit and run it.
In ExtendScript Toolkit, select Adobe RoboHelp 8 from the ExtendScrip Toolkit pop-up menu and click the Click
To Connect To Target Application
to run RoboHelp.

RoboHelp sample scripts

RoboHelp provides a set of sample scripts that you can use or customize. You can use these sample scripts to do the following:
EclipseHelp Use this script to convert WebHelp output to EclipseHelp output. See the script for more details.
Link Converter Use this script to convert an anchor link href target across all the files in a RoboHelp project. For
example, define a link to convert www.adobe.com to www.adobe.com/support/ across all the Help files in a project. See the script file for more information.
2
MultiMasterPageImport Use this script to select multiple master pages and import them.
SaveAsProjectTemplate Use this script to save a RoboHelp project as a template for creating similar RoboHelp
projects.
UDV Converter with UI Use this script to convert a keyword into a user-defined variable and change its value across all
files in a project. Enter a keyword, a user-defined variable name, and its value.
UDV Converter Use this script to convert a keyword into a user-defined variable and change its value across all the files
in a project. See the script for more details.
Word Count Use this script to get a word count for an open RoboHelp project. It provides a word count by topic and
by project. To run the Word Count script, right-click the script and select Run. The word count summary appears in the Output View pod.

RoboHelp object model

The RoboHelp object model is based on the principles of a document object model (DOM). A DOM is an application programming interface (API) that allows you to programmatically access various components of a document (as defined for that application) through a scripting language. The principle behind a DOM is the containment hierarchy. In other words, top-level objects in a DOM contain next-level objects, which contain the subsequent level of objects, and so on.
Each node in the Robohelp containment hierarchy is a class. The RoboHelp class sits at the top of the hierarchy and is a collection of classes and constants. To accomplish a task through scripting, you need to reference these objects following the parent-child relationship defined in the containment hierarchy.
For example, if you want to specify Adobe® AIR® Help as the single-source layout for a RoboHelp application, the object reference in your script needs to be:
ROBOHELP 8 SCRIPTING GUIDE
RoboHelp.SSLLayoutType.AIRHELP
SSLLayout is a child class of the RoboHelp class, and AIRHELP is a property of the SSLLayout class.
RoboHelp
3
Scripting basics
TokenManager
Token
RoboHelp containment hierarchy
Project
TopicManager
Topic
MasterPageManager
MasterPage
SnippetManager
Snippet
UDVManager
UDV
FileManager
File
TOCManager
TOC
IndexManager
Index
GlossaryManager
Glossary
SkinManager
Skin
CBTManager
CBT
SSLManager
SSL
FMFileManager
FMFile
WordFileManager
WordFile
ServerManager
Server
HTMLHelpWindowManager
HTMLHelpWindow
ReportManager
MapIDManager
SSLLayoutType
Language
ReportType
DeleteOption
Status
SkinType
FrameFileFormat
TokenType
TagType
FileStatus
SynchStatus
ServerType
WordFileFormat
HTMLHelpWindowAlign
HTMLHelpWindowDefaultTab
HTMLHelpWindowButtons
HTMLHelpWindowProperties
For more information on classes, see “Classes” on page 4.
For more information on constants, see “Constants” on page 83.

Chapter 2: Classes

RoboHelp

Main class for interacting with a RoboHelp application.

RoboHelp properties

Property name Data type Description
version String Read-only
RoboHelp product version
name String Read-only
Product name
path String Read-only
Full path to the RoboHelp application executable
4
language Integer constant Read-only
RoboHelp language settings
project Project Project object
SSLLayoutType SSLLayoutType Read-only
SSLLayoutType constant
Language Language Read-only
Language constant
ReportType ReportType Read-only
ReportType constant
DeleteOption DeleteOption Read-only
DeleteOption constant
Status Status Read-only
Status constant
SkinType SkinType Read-only
SkinType constant
FrameFileFormat FrameFileFormat Read-only
FrameFileFormat constant
TokenType TokenType Read-only
TokenType constant
TagType TagType Read-only
TagType constant
Property name Data type Description
FileStatus FileStatus Read-only
FileStatus constant
SyncStatus SyncStatus Read-only
SyncStatus constant
ServerType ServerType Read-only
ServerType constant
WordFileFormat WordFileFormat Read-only
WordFileFormat constant

RoboHelp methods

openProject
Description
Opens .mpj and .xpj projects in a RoboHelp application.
ROBOHELP 8 SCRIPTING GUIDE
Classes
5
Syntax
openProject (projectPath, upgradeIfRequired)
Parameters
Parameter name Data type Optional Description
projectPath String No Full path to the project file that you want to
upgradeIfRequired Boolean Yes Upgrade the project if created in an older
open
version of RoboHelp.
The default value is false.
If the project does not require an upgrade, this parameter is ignored.
getTokenManager
Description
Returns Token Manager for the specified file.
Returns
TokenManager
Syntax
getTokenManager (fullFilePath)
ROBOHELP 8 SCRIPTING GUIDE
Parameters
Parameter name Data type Optional Description
fullFilePath String No Full path to the file that you want to open
getCurrentProject
Description
Returns the active project object.
Returns
Project
Syntax
getCurrentProject ()
closeProject
Description
Closes the active project.
6
Classes
Note: Unsaved topic files are not saved.
Returns
String
Syntax
closeProject ()
newProject
Description
Creates a project.
Returns
Project
Syntax
newProject (template, projectName, projectPath, title, firstTopic, language, saveSettings)
Parameters
Parameter name Data type Optional Description
ROBOHELP 8 SCRIPTING GUIDE
Classes
7
template String No Name of the template or full path to the
projectName String No Name of the project
projectPath String No Full path to the location where the project will
title String Yes Title of the project
firstTopic String Yes Title of the first topic
language Integer constant Yes Lanuage for the project
saveSettings Boolean Yes Saves the specified language as the default
Template.hpr file. Specify an empty string to create a blank project.
be created
language for new projects
newProjectImport
Description
Creates a project from a DITA map.
Returns
Project
Syntax
newProjectImport (projectName, outputFolder, DITAOTHomeDirectory, ditavalFile, topHeader,
bodyHeader, bodyFooter, xslFile, indexShow)
Parameters
Parameter name Data type Optional Description
projectName String No Full path to the DITA map file
outputFolder String No Full folder path where the project will be
DITAOTHomeDirectory String No Full path to the DITA Open Toolkit home
ditavalFile String Yes Full path to the Ditaval file for filtered
topHeader String Yes Full path to the file containing XHTML to place
bodyHeader String Yes Full path to the file containing XHTML to place
created
directory
processing
in the header area of the output file
in the body running-header area of the output file
Parameter name Data type Optional Description
ROBOHELP 8 SCRIPTING GUIDE
Classes
8
bodyFooter String Yes Full path to the file containing XHTML to place
xslFile String Yes Full path to the XSL file that is used instead of
indexShow Boolean Yes Use this option to show or hide index entries
in the body running-footer area of the output file.
the default XSL file to transform the topics to XHTML
bringToFront
Description
Makes the RoboHelp application the active window.
Syntax
bringToFront ()
quit
Description
Exits the RoboHelp application.
Syntax
quit ()
executeScript
Description
Runs a script file.
Returns
String
Syntax
executeScript (scriptFilePath)
Parameters
Parameter name Data type Optional Description
scriptFilePath String No Full path to the script file to run
closeAllWindows
Description
Closes all active document windows in the RoboHelp application.
Syntax
closeAllWindows ()

Project

Main class for handling project-related activities.

Project properties

Property name Data type Description
name String Read-only
Project name
title String Read-only
Project title
path String Read-only
Full path to the project main folder
ROBOHELP 8 SCRIPTING GUIDE
Classes
9
typename String Read-only
Class name of the reference object
language Language Read-write
Project language settings
TopicManager TopicManager Read-only
TopicManager object
MasterPageManager MasterPageManager Read-only
MasterPageManager object
SnippetManager SnippetManager Read-only
SnippetManager object
UDVManager UDVManager Read-only
UDVManager object
FileManager FileManager Read-only
FileManager object
TOCManager TOCManager Read-only
TOCManager object
IndexManager IndexManager Read-only
IndexManager object
GlossaryManager GlossaryManager Read-only
GlossaryManager object
SkinManager SkinManager Read-only
SkinManager object
Property name Data type Description
CBTManager CBTManager Read-only
CBTManager object
SSLManager SSLManager Read-only
SSLManager object
FMFileManager FMFileManager Read-only
FMFileManager object
WordFileManager WorldFileManager Read-only
WordFileManager object
ReportManager ReportManager Read-only
ReportManager object
ServerManager ServerManager Read-only
ServerManager object
MapIdManager MapIdManager Read-only
MapIdManager object
ROBOHELP 8 SCRIPTING GUIDE
Classes
10
HTMLHelpWindowManager HTMLHelpWindowManager Read-only
HTMLHelpWindowManager object

Project methods

importSettings
Description
Imports the settings file (*.isf) into the current project.
Returns
Boolean
Syntax
importSettings (settingsFilePath)
Parameters
Parameter name Data type Optional Description
settingsFilePath String No Full path to the .isf settings file
exportSettings
Description
Exports the settings file (*.isf) from the current project.
ROBOHELP 8 SCRIPTING GUIDE
Returns
Boolean
Syntax
exportSettings (settingsFilePath, overwriteFile)
Parameters
Parameter name Data type Optional Description
settingsFilePath String No Full path to the .isf settings file
overwriteFile Boolean Yes Flag to overwrite the existing file
The default value is true.
outputMessage
Description
Displays the message on the Output View pod.
11
Classes
Returns
Boolean
Syntax
outputMessage (message)
Parameters
Parameter name Data type Optional Description
message String No String message to display
rename
Description
Renames the current project.
Returns
Boolean
Syntax
rename (newName)
Parameters
Parameter name Data type Optional Description
newName String No New name for the project
ROBOHELP 8 SCRIPTING GUIDE
updateAll
Description
Updates all linked documents (FrameMaker documents and Word documents) in the project.
Returns
Boolean
Syntax
updateAll (flagForceUpdate)
Parameters
Parameter name Data type Optional Description
12
Classes
flagForceUpdate Boolean No Flag to force the update of all linked
documents
importDITAMap
Description
Imports a DITA map file into the project.
Returns
Boolean
Syntax
importDITAMap (projectName, DITAOTHomeDirectory, ditavalFile, topHeader, bodyHeader,
bodyFooter, xslFile, indexShow)
Parameters
Parameter name Data type Optional Description
projectName String No Full path to the DITA map file
DITAOTHomeDirectory String No Full path to the DITA Open Toolkit home
ditavalFile String Yes Full path to the Ditaval file for filtered
directory
processing
topHeader String Yes Full path to the file containing XHTML to place
bodyHeader String Yes Full path to the file containing XHTML to place
in the header area of the output file
in the body running-header area of the output file
Parameter name Data type Optional Description
ROBOHELP 8 SCRIPTING GUIDE
Classes
13
bodyFooter String Yes Full path to the file containing XHTML to place
xslFile String Yes Full path to the XSL file that is used instead of
indexShow Boolean Yes Use this option to show or hide index entries
in the body running-footer area of the output file.
the default XSL file to transform topics to XHTML
autoCreateBrowseSequence
Description
Creates browse sequences based on a specified TOC.
Returns
Boolean
Syntax
autoCreateBrowseSequence (TOC object, level)
Parameters
Parameter name Data type Optional Description
TOC object TOC Yes A TOC object on which the browse sequences
will be based. If not specified, the default TOC of the project is used.
level Integer Yes Creates a separate sequence for each book
down to this level. If not specified, the last set value is used.
importHtmlFile
Description
Imports an HTML file into the current project.
Returns
Boolean
Syntax
importHtmlFile (filePath,folderName)
Parameters
Parameter name Data type Optional Description
filePath String No Absolute path of the HTML file to import
folderName String No Relative path of the folder in the current
project in which the HTML file is to be imported
ROBOHELP 8 SCRIPTING GUIDE
importWordDoc
Description
Imports a Word document into the current project.
Returns
Boolean
Syntax
importWordDoc (filePath, folderName, TOCName, addIndexToTopic, indexName, glossaryName)
Parameters
Parameter name Data type Optional Description
14
Classes
filePath String No Absolute path of the Word document to
folderName String No Relative path of the folder in the current
TOCName String No Name of the existing or new TOC for the
addIndexToTopic Boolean No Whether the index from the Word document
indexName String No If addIndexToTopic is false, this is the name
glossaryName String No Name of the existing or new glossary for the
import
project in which the Word document is to be imported
imported Word document
is added to the imported topics or not
of the existing or new index for the imported Word document.
imported Word document
importFrameMakerDoc
Description
Imports a FrameMaker document into the current project.
Returns
Boolean
Syntax
importFrameMakerDoc (filePath, folderName, frameMakerTOCFilePath, TOCName, addIndexToTopic,
indexName, glossaryName)
Parameters
Parameter name Data type Optional Description
ROBOHELP 8 SCRIPTING GUIDE
Classes
15
filePath String No Absolute path of the FrameMaker document
folderName String No Relative path of the folder the in the current
frameMakerTOCFilePath String No Absolute path of the FrameMaker TOC file for
TOCName String No Name of the existing or new TOC for the
addIndexToTopic Boolean No Whether the index from the FrameMaker
indexName String No If addIndexToTopic is false, this is the name
glossaryName String No Name of the existing or new glossary for the
to import
project in which the FrameMaker document is to be imported
the FrameMaker document to import
imported FrameMaker document
document is added to the imported topics or not
of the existing or new index for the imported FrameMaker document.
imported FrameMaker document

TokenManager

Handles tokens for a specific file.

TokenManager properties

Property name Data type Description
parent RoboHelp Read-only
RoboHelp application object
typename String Read-only
Class name of the reference object
count Integer Read-only
Number of tokens in the file
valid Boolean Read-only
Checks if the token file is valid or not

TokenManager methods

item
Description
Returns the token specified by the index.
ROBOHELP 8 SCRIPTING GUIDE
Returns

Token

Syntax
item (index)
Parameters
Parameter name Data type Optional Description
index Integer No Index for the token
save
Description
Saves the specified token file.
Returns
Boolean
16
Classes
Syntax
save ()
Token
Handles a specific token.

Token properties

Property name Data type Description
parent TokenManager Read-only
Parent TokenManager object
name String Read-only
Text from the token object
typename String Read-only
Class name of the reference object
previous Token Read-only
Returns the previous token object
Property name Data type Description
next Token Read-only
Returns the next object
tokenType Integer constant Read-only
Type of token
tagType Integer constant Read-only
Returns the type of tag if tokenType is TOKENTAG

Token methods

update
Description
Updates the text of the token if tokenType is TOKENTEXT.
Returns
Boolean
ROBOHELP 8 SCRIPTING GUIDE
Classes
17
Syntax
update (newText)
Parameters
Parameter name Data type Optional Description
newText String No New text string to update for the token
getAttribute
Description
Returns the specific attribute value.
Returns
String
Syntax
getAttribute (attributeName)
Parameters
Parameter name Data type Optional Description
attributeName String No Name of the attribute
ROBOHELP 8 SCRIPTING GUIDE
setAttribute
Description
Sets the specific attribute value.
Returns
Boolean
Syntax
setAttribute (attributeName, attributeValue)
Parameters
Parameter name Data type Optional Description
attributeName String No Name of the attribute
attributeValue String No Value of the attribute
removeAttribute
18
Classes
Description
Removes the specific attribute value.
Returns
Boolean
Syntax
removeAttribute (attributeName)
Parameters
Parameter name Data type Optional Description
attributeName String No Name of the attribute
insertText
Description
Inserts a new text token before or after the specified token.
Returns
Boolean
Syntax
insertText (newText, afterCurrentTag)
Parameters
Parameter name Data type Optional Description
newText String No New text to insert
ROBOHELP 8 SCRIPTING GUIDE
Classes
19
afterCurrentTag Boolean Yes Inserts a new text token before a specified
token
By default, the new token is inserted after the current tag.
delete
Description
Removes the token.
Returns
Boolean
Syntax
delete ()

TopicManager

Handles all topics in the current project.

TopicManager properties

Property name Data type Description
parent Project Read-only
Project object
typename String Read-only
Class name of the reference object
count Integer Read-only
Number of topics present in the project

TopicManager methods

item
Description
Returns the topic specified by the index.
Returns
Topic
ROBOHELP 8 SCRIPTING GUIDE
Syntax
item (index)
Parameters
Parameter name Data type Optional Description
index Integer No Index for the topic
newItem
Description
Creates a topic in the current project.
Returns
Topic
Syntax
newItem (topicTitle, fileName, language)
20
Classes
Parameters
Parameter name Data type Optional Description
topicTitle String No Title of the topic
fileName String No Filename of the topic
language Integer constant No Language of topic
importItem
Description
Imports an HTML file into the current project.
Returns
Topic
Syntax
importItem (filePath, folderName)
Parameters
Parameter name Data type Optional Description
filePath String No Absolute path of the HTML file to import
folderName String No Relative path of the folder in the current
project in which the HTML file is to be imported

MasterPageManager

Handles all master pages in the current project.

MasterPageManager properties

Property name Data type Description
parent Project Read-only
Project object
typename String Read-only
Class name of the reference object
count Integer Read-only
Number of master pages present in the project

MasterPageManager methods

ROBOHELP 8 SCRIPTING GUIDE
Classes
21
item
Description
Returns the master page specified by the index.
Returns
MasterPage
Syntax
item (index)
Parameters
Parameter name Data type Optional Description
index Integer No Index for the master page
newItem
Description
Creates a master page in the current project.
Returns
MasterPage
Syntax
newItem (title, css, desc)
ROBOHELP 8 SCRIPTING GUIDE
Parameters
Parameter name Data type Optional Description
title String Yes Title of the master page
The filename for the master page is also same as the title.
css String Yes CSS to attach
The path of the CSS file must be relative to the project path. If this parameter is null, no CSS is attached. If this parameter is not specified or is empty, the default CSS of the project is attached.
desc String Yes Description
importItem
Description
Imports a master page into the current project.
22
Classes
Returns
MasterPage
Syntax
importItem (filePath)
Parameters
Parameter name Data type Optional Description
filePath String No Absolute path of the master page to import

SnippetManager

Handles all snippets in the current project.

SnippetManager properties

Property name Data type Description
parent Project Read-only
Project object
typename String Read-only
Class name of the reference object
count Integer Read-only
Number of snippets present in the project
ROBOHELP 8 SCRIPTING GUIDE

SnippetManager methods

item
Description
Returns the snippet specified by the index.
Returns
Snippet
Syntax
item (index)
Parameters
Parameter name Data type Optional Description
index Integer No Index for the snippet
23
Classes
newItem
Description
Creates a snippet in the current project.
Returns
Snippet
Syntax
newItem (snippetName)
Parameters
Parameter name Data type Optional Description
snippetName String No Name of the snippet
importFile
Description
Imports an existing snippet into the current project.
Returns
Snippet
Syntax
importFile (snippetFilePath)
ROBOHELP 8 SCRIPTING GUIDE
Parameters
Parameter name Data type Optional Description
snippetFilePath String No Full path of the snippet file

UDVManager

Handles all user-defined variables (UDVs) in the current project.

UDVManager properties

Property name Data type Description
parent Project Read-only
Project object
typename String Read-only
Class name of the reference object
24
Classes
count Integer Read-only
Number of UDVs present in the project

UDVManager methods

item
Description
Returns the UDV specified by the index.
Returns
UDV
Syntax
item (index)
Parameters
Parameter name Data type Optional Description
index Integer No Index for the UDV
newItem
Description
Creates a UDV in the current project.
ROBOHELP 8 SCRIPTING GUIDE
Returns
UDV
Syntax
newItem (UDVName, UDVValue)
Parameter
Parameter name Data type Optional Description
UDVName String No Name of the new UDV
UDVValue String No Value of the new UDV

FileManager

Handles all files in the current project.

FileManager properties

25
Classes
Property name Data type Description
parent Project Read-only
Project object
typename String Read-only
Class name of the reference object
count Integer Read-only
Number of files present in the project

FileManager methods

item
Description
Returns the file specified by the index.
Returns
File
Syntax
item (index)
Parameters
Parameter name Data type Optional Description
index Integer No Index for the file
checkoutAll
Description
Checks out all files in the current project from the version control system.
Returns
Boolean
Syntax
checkoutAll ()
checkinAll
Description
Checks in all files in the current project to the version control system.
Returns
Boolean
ROBOHELP 8 SCRIPTING GUIDE
Classes
26
Syntax
checkinAll ()
getLatestAll
Description
Gets the latest version of all the files from the version control system into the current project.
Returns
Boolean
Syntax
getLatestAll ()

TOCManager

Handles all TOCs in the current project.
Loading...
+ 68 hidden pages