Highlighted

RH 2017 - variables values missing from the list of variables

Explorer ,
Jan 23, 2019

Copy link to clipboard

Copied

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?

TOPICS
HTML5 layout

Views

429

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

RH 2017 - variables values missing from the list of variables

Explorer ,
Jan 23, 2019

Copy link to clipboard

Copied

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?

TOPICS
HTML5 layout

Views

430

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 23, 2019 0
Adobe Community Professional ,
Jan 24, 2019

Copy link to clipboard

Copied

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

www.grainge.org for free RoboHelp & Authoring info. Use the blue Reply button at the top to help me help you.
The black Reply link nests replies and they sort out of order.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 24, 2019 0
Explorer ,
Jan 24, 2019

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 24, 2019 0
Adobe Community Professional ,
Jan 24, 2019

Copy link to clipboard

Copied

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).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 24, 2019 0
Adobe Community Professional ,
Jan 25, 2019

Copy link to clipboard

Copied

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

Both Amber and I have covered that. RoboHelp's own find and replace will work but its issue is it will fail where the find is on multiple lines. There are free search and replace tools that you can find using Google. Amber has covered the script issues.

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.

Isn't the problem that what you are looking for is no longer 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.

Have you tried deleting the CPD before opening the project again?

****************************************

Let us know when you have tried the earlier solutions.


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

@petergrainge

www.grainge.org for free RoboHelp & Authoring info. Use the blue Reply button at the top to help me help you.
The black Reply link nests replies and they sort out of order.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 25, 2019 0
Explorer ,
Jan 29, 2019

Copy link to clipboard

Copied

I tried the UDV Converter with UI option from the scripts in RH 2017. The term gets replaced with the variable. The variable also gets created correctly. However, when you open the help topics where the term has been replaced, RH 2017 crashes. It just closes down saying RH stopped working.

I tried deleting the CPD and reopening RH 2017. It opens but when I try opening the help topics where the term has been replaced, RH 2017 crashes again.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 29, 2019 0
Adobe Community Professional ,
Jan 30, 2019

Copy link to clipboard

Copied

I can only refer you back to the earlier solutions. Looks like trying with the script is like flogging a dead horse.


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

@petergrainge

www.grainge.org for free RoboHelp & Authoring info. Use the blue Reply button at the top to help me help you.
The black Reply link nests replies and they sort out of order.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 30, 2019 0
Adobe Community Professional ,
Jan 24, 2019

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 24, 2019 0