User Defined Variables are a great way to manage content that appears frequently in your RoboHelp project. Variables allow you to change all occurrences of say, your company name in your project from a single location.
If you have already created a RoboHelp project but weren't aware of variables, you will be happy to learn that there is a script that quickly converts all occurrences of a word or phrase to a variable.
In my example below, I'm going to use the script to replace the word IconLogic shown below to a variable.
- Make a backup of your project (this script will update your topics, and its better to be safe than sorry).
- Choose Tools > Scripts > UDV Converter with UI.
- In the Enter value to replace field, type a word or phrase. (I've entered IconLogic.)
- In the Enter new UDV name field, add the name of the variable to be created. In this case, I used CompanyName.
- In the Enter UDV value field, add a value for the variable. (In this case, I used the phrase IconLogic, Inc.)
- Click Convert.
The script will go through the project and convert the text you indicated into a variable. In my example, the word IconLogic changed into the variable CompanyName. Because the value of the variable is IconLogic, Inc, that's the text users will see.
Note: When running the script, only topic content is updated. (You can see in the image above that the topic title in the tab is left unchanged). If you want to modify the title, you will have to manually apply the variable in the topic title. Also, if your variables aren't green, check out my article about showing variables in topics.
I ran this script in a WebHelp project using RoboHelp 2015 to convert text in multiple topics to a variable. Unfortunately, RoboHelp crashed every time I tried to compile the help project after creating the variable using this script.
I did not consider the variable as the cause of the crashes until I noticed the rhvariable.apj file was the only file that had changed since I had last successfully compiled the help project. As a result, I deleted the variable, replacing the variable with its content in each topic. Once I deleted the variable, the project compiled successfully.
Interestingly enough, I created this same variable in another WebHelp project. However, I applied that variable manually in each topic instead of using the script. RoboHelp did not crash when I compiled that help project.
Posted by: George Hale | April 25, 2016 at 02:32 PM
That's strange behaviour. What was the name or new value of the variable? I can only think of a problem when RoboHelp didn't like the name or value provided.
Posted by: Willam van Weelden | April 26, 2016 at 03:16 AM