15
ExtendScript Getting Started Part 2 Willam van Weelden

Getting Started with ExtendScript for RoboHelp - part 2/2

Embed Size (px)

Citation preview

Page 1: Getting Started with ExtendScript for RoboHelp - part 2/2

ExtendScriptGetting Started Part 2

Willam van Weelden

Page 2: Getting Started with ExtendScript for RoboHelp - part 2/2

Get the files

• http://robohelp.wvanweelden.eu/Getting started webinar.zip

Page 3: Getting Started with ExtendScript for RoboHelp - part 2/2

What you will need

• ExtendScript Toolkit (included with RoboHelp)

• Adobe RoboHelp

• RoboHelp Scripting Guide• Overview of variables and constants also available in ExtendScript

Toolkit

• Editor with JavaScript Syntax Highlighting• Optional. I prefer Notepad++ over the ExtendScript Toolkit

Page 4: Getting Started with ExtendScript for RoboHelp - part 2/2

RoboHelp API

Page 5: Getting Started with ExtendScript for RoboHelp - part 2/2

RoboHelp API: Constants

Page 6: Getting Started with ExtendScript for RoboHelp - part 2/2

RoboHelp API: Accessing Topics

Page 7: Getting Started with ExtendScript for RoboHelp - part 2/2

Scripting Events

• Schedule script to run automatically

• Needs to be set for every RoboHelp Installation separately

Page 8: Getting Started with ExtendScript for RoboHelp - part 2/2

Events 1/2Event Event occurs

closeTopic When a topic is closed

openTopic When a topic is opened

preImport Before a file is imported

postImport After a file is imported

postSSLGenerate

After an SSL is generatedNote: When you have an SSL with multiple content categories, this event is fired for every category.

preSSLGenerate

Before an SSL is generatedNote: When you have an SSL with multiple content categories, this event is fired for every category.

Page 9: Getting Started with ExtendScript for RoboHelp - part 2/2

Events 2/2Event Event occurs

preWordDocUpdate Before a linked Word document is updated

postWordDocUpdate After a linked Word document is updated

preFrameMakerDocUpdateBefore a linked FrameMaker document is updated

postFrameMakerDocUpdateAfter a linked FrameMaker document is updated

SaveAll When the Save All button is clicked

postTopicUpdate After a topic is updated

preImportPDFComments Before importing PDF review comments

postImportPDFComments After importing PDF review comments

preCreateReviewPDF Before creating a PDF review document

postCreateReviewPDF After creating a PDF review document

openProject When a project is opened

preCloseProject Before a project is closed

postSOpenProject After a project is closed

Page 10: Getting Started with ExtendScript for RoboHelp - part 2/2

Watch out!

• Only functions are available.

• Global variables unavailable.

• Object.prototype functions unavailable.

Page 11: Getting Started with ExtendScript for RoboHelp - part 2/2

Deep Dive

• Schedule script to run automatically

• Get files from template directory

• Coyp files into the output

Page 12: Getting Started with ExtendScript for RoboHelp - part 2/2

Plan

• Get the SSL whenever an output is created

• Check whether you want this SSL to be processed

• Get the SSL output directory

• Copy skin files over

Page 13: Getting Started with ExtendScript for RoboHelp - part 2/2

Make it easy!

• Willam’s RoboHelp ExtendScript Library

• Full Documentation

• Compatible with scripting events. Even the global variables and custom methods.

• Shortcuts for many common features• Setting SSL settings• Get and assign map id and map # for Context Senstive Help• Support for linked documents• And much more!

• 100% Free!

Page 14: Getting Started with ExtendScript for RoboHelp - part 2/2

Sample: Get Token by Tag Name

Page 15: Getting Started with ExtendScript for RoboHelp - part 2/2

ExtendScriptQuestions?