If you have ever used Microsoft Word to record or write a macro using Visual Basic, you already appreciate how much time macros can save you by automating repetitive tasks.
While RoboHelp does not support macros, scripts (which are coded instructions) provide the same functionality. RoboHelp ships with a few helpful scripts and if you are an application developer, you can create your own scripts from within RoboHelp or import them.
Run a Word Count Script
- Open a RoboHelp project
- Open the Script Explorer by choosing View > Pods > Script Explorer
The Script Explorer pod appears at the far right of the window by default.
- Click the plus sign to the left of the Sample Scripts folder to expand the folder
- On the Script Explorer pod, right-click the Word Count.jsx script and choose Run
The word count is quickly completed and the total Word Count appears at the bottom of the Output View pod.
Edit a Script
Okay, so the word count script you just learned about is nice and all, but hardly anything to write home about. Get your pen and paper out... this next script rocks.
How many times have you found a web address in your project that wasn't correct? And how many times has that Web address needed to be corrected in multiple locations? This next script will let you fix URLs project-wide.
- On the Script Explorer pod, right-click the Link Converter.jsx script and choose Edit
The Extend Script Toolkit opens.
- On line 10 of the script, replace www.oldurl.com with the address you want the script to find and correct
- Replace www.newurl.com with the correct address
- Save and close the script (choose File > Save and then choose File > Exit)
- On the Script Explorer pod, right-click the Link Converter.jsx script and choose Run
Any files using the incorrect Web address are opened and corrected. You will be prompted to save each file that has been edited.
Need to learn RoboHelp... and fast? Join my live, two-day RoboHelp class later this month.