Skip to main content
Tejas Dandekar
Inspiring
January 23, 2019
Question

RH 2017 - variables values missing from the list of variables

  • January 23, 2019
  • 2 replies
  • 838 views

Hi,

We have a RH 2017 source that uses few variables specially for product names. I noticed that few variable values have gone missing from the list of variables.

The variable value that is present in the content in the topic appears as normal text. Not sure why this happened. I don't think anyone has mistakenly deleted the variable values.

In future to add back the variables would be a massive task. Is there any way out?

This topic has been closed for replies.

2 replies

Community Expert
January 24, 2019

If you can't get the variables back using Peter's suggestions, there are two scripts available to convert a text string to a variable.

UDV Converter - script only. You have to enter the  details into the script file before running it.

UDV Converter with UI - running the script displays a dialog box that allows you to enter the text string you want to replace with a variable, a name for the variable, and the variable value.

I forget the exact location to run it in RH2017 (I need to go home to check) but in RH11 it's in the Tools > Scripts > [script name], so I assume that probably translates to a similarly named tab in the ribbon.

Do note that it has a bug that won't find your text string if it spans a line break in the behind the scenes HTML source code. Typically this appears to be in lists and tables. (I've frankensteined[1]  myself a slightly better version of the script, but I'm not a programmer and it hasn't been tested much so I couldn't guarantee that it won't break something, or miss certain string combinations. If you find that the script doesn't find enough instances of your string, I could post it, but use at your own risk.)

(I'll be submitting it to Adobe as a bug, but given they've killed the script function in RH2019, I suspect we'd be really lucky if they released a fixed version.)

[1] spliced in chunks of code from other Adobe RH scripts

Peter Grainge
Community Expert
Community Expert
January 24, 2019

I have not seen that reported  before and the only way I can think of is when you deliberately delete a variable, you get a dialog with options, one being to convert to text.

When you delete a variable, you can multi-select. Perhaps someone did that accidentally?

Regardless of how it happened, you need a way back. Variables are stored in the rhvariable.apj file. Open that in a text editor and see if the variables are there. If they are then close the project and create a backup. I always recommend creating the backup as a zip file. That prevents you opening it accidentally and working on it before you realise it was the backup. This way you always have a clean backup that can be used to create a new clean copy time after time.

If the rhvariable.apj file was empty, get a copy from a backup and overwrite the empty file.

Now delete the CPD file and reopen the project. Does that restore the list? If it does, does it also convert the text back to variables. I doubt it but who knows. That bit may have to be manual.

If the values are unique words, you could try a find and replace operation by correcting one instance of each value and using that code as the replace. That is not an option if the term is unique unless the find and replace tool allows you to confirm or reject each instance.

Let us know how you get on.


See www.grainge.org for free RoboHelp and Authoring information.

@petergrainge

Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
Tejas Dandekar
Inspiring
January 25, 2019

I haven't tried the above steps yet. I shall soon.

Isn't there a way where we do a regular find and replace and find the desired word and replace it with a variable?

Is there a way to identify a variable...for example find ABC and replace with [ABC] or something like that where we can input a variable.

The UDV Converted with UI works and gives the desired results however, when you open the help topics later, RH2017 crashes.Looks like there is a bug with the script.

Community Expert
January 25, 2019

The script, as far as I know, is the closest you'll get to "find ABC and replace with [ABC]".

I've used it successfully in RH11, so it could be something to do with what you entered in each field. Can you provide an example of what  you entered in each field? I'll try to reproduce the crash over the weekend with RH2017.

You could also do it with the Find and Replace as per Peter's last suggestion. However, you would have to step through each match to decide whether to replace that instance, otherwise you will end up with a crash because the text that is already a UDV will be replaced again, resulting in an invalid duplicate code.

Or you would need to be very good at regular expressions, depending on the Find Replace dialog box's support for regex (I seem to remember support is very basic).