Site Tools


New release available: 2020-07-29 "Hogfather". upgrade now! [51.3] (what's this?)
New release candidate 3 available: 2020-06-09 "Hogfather". upgrade now! [51.2] (what's this?)
New release candidate 2 available: 2020-06-01 "Hogfather". upgrade now! [51.1] (what's this?)
New release candidate available: 2020-06-01 "Hogfather". upgrade now! [51] (what's this?)
Hotfix release available: 2018-04-22c "Greebo". upgrade now! [50.3] (what's this?)
start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
start [2018/04/02 11:04]
willam
start [2020/02/26 17:10] (current)
Line 1: Line 1:
 +====== RoboHelp ExtendScript Library ======
 +The RoboHelp ExtendScript Library is a library with many useful functions and methods
 +to help you create scripts for RoboHelp. With this library you can focus on what
 +your scripts need to do rather than creating methods for handling common tasks. This
 +RoboHelp ExtendScript Library is the basis of all scripts offered through Help Essentials.
  
 +This library is free to use, but it also without warranty of any kind. If you need
 +help using the library, don't hesitate to contact me.
 +
 +The RoboHelp ExtendScript library was last updated on: 02-04-2018
 +
 +Get the libray: [[https://​www.helpessentials.com/​product/​extendscript-library/​|RoboHelp ExtendScript Library on HelpEssentials]]
 +
 +===== Install the Library =====
 +Before you can use the RoboHelp ExtendScript library, you need to install the library
 +on your computer. You need to copy all the library files to a location on your computer,
 +such as ''​C:​\ExtendScriptLib''​. Make sure that all the files are copied to the same directory.
 +
 +===== Configure Library for 7-Zip =====
 +The library contains functions to zip and unzip an archive using 7-Zip. If you want
 +to use 7-Zip for archiving and extracting, you need to configure the library to use
 +it.
 +
 +**Note**: RoboHelp has its own zip function ''​RoboHelp.createZipFile()''​. This method was
 +added after this library was created. The 7-Zip option has more features but the
 +default RoboHelp solution will work for most.
 +
 +  - Ordered List ItemDownload and install 7-Zip
 +  - Open the file ''​lib.jsxinc''​ with Notepad++ or a different code editor
 +  - Go to the global variable ''​v7Location''​
 +  - Add the complete path to the 7-Zip executable. Example:\\ \\ <code javascript>​var v7Location = '​C:​\\Program Files\\7-Zip\\7z.exe'</​code>​
 +  - Save your changes
 +
 +===== Using the Library =====
 +In order to use the RoboHelp ExtendScript Library in your scripts, you need to reference the library in your scripts. You can load the library at any time during script execution.
 +
 +To load the library in your script, add the following line:
 +
 +<code javascript>#​include "<​path to library>/​lib.jsxinc"</​code>​
 +
 +Example:
 +
 +<code javascript>#​include "​C:/​ExtendScriptLib/​lib.jsxinc"</​code>​
 +
 +You can now use the variables, functions and methods of the library in your script.
 +
 +===== RoboHelp Scripting Events =====
 +When you are using RoboHelp scripting events, you need to intiallise the library
 +before you can use all methods and features. To initialise the library, rund the
 +function ''​libInit()''​ as soon as your function is called by the event:
 +
 +<code javascript>​
 +function runOnEvent(parameter) {
 +   //​Initialize the library.
 +   libInit();​
 +   
 +   //​Your script starts here after the library is loaded
 +}
 +</​code>​
 +
 +The library contains methods and functions that allow the same actions. The functions
 +are always available, even if you don't initialise the library. The following can
 +be run wihout initialising the library:
 +
 +<code javascript>​
 +var file = new File("​C:/​temp/​file.txt"​);​
 +var content = readFile(file);​
 +</​code>​
 +
 +If the library is initialised as shown above, you can also run:
 +
 +<code javascript>​
 +var file = new File("​C:/​temp/​file.txt"​);​
 +var content = file.readFile();​
 +</​code>​
 +
 +Looking for an introduction to RoboHelp scripting events? Check out these resources:
 +  * [[http://​www.adobe.com/​devnet/​robohelp/​articles/​robohelp10-scripting-events.html|Using the new RoboHelp 10 scripting events]] by Willam van Weelden
 +  * [[https://​2016-10-18-robohelp-extendscript.meetus.adobeevents.com/​|Webinar Getting Started with ExtendScript - part 2]] by Willam van Weelden