Adobe 65030089 Scripting Guide - Page 5

Scripting basics

Page 5 highlights

1 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. 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.

  • 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

1
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.
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.