Adobe 65030089 Scripting Guide - Page 6

RoboHelp object model

Page 6 highlights

ROBOHELP 8 SCRIPTING GUIDE 2 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. 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:

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98

2
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.
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: