Skip to main content
Inspiring
March 10, 2017
Answered

Update Variable across the Book

  • March 10, 2017
  • 2 replies
  • 5716 views

Hi All,

If I have a Book with 10 Chapters; in each chapter, I have a Variable called "Manual Name".

Is there a way to change a variable value, so it can be updated in entire book at once?

If it involves more scripting, how difficult would that be?

Any insight would be greatly appreciated.

Thanks.

This topic has been closed for replies.
Correct answer Arnis Gubins

Expanding on what Matt said about creating a MIF file, it's just a simple text file called a MIF snippet that looks like this:

<MIFFile 14.00>

<VariableFormats

<VariableFormat

   <VariableName `MyBookName'>

   <VariableDef `The title of this book'>

  > # end of VariableFormat

> # end of VariableFormats

Also have a look at this thread, which covers the same topic: Variable to Pull Book Name?

Finally, you could also try Leximation's BookVars. See: http://leximation.com/tools/info/bookvars.php

2 replies

Matt-Tech Comm Tools
Community Expert
Community Expert
March 10, 2017

You can do this (at least) two ways:

  1. Import variables  by using the File>Import>Formats command across all files of the book.
    1. advantage: easy, quick
    2. disadvantage: all variables are updated, and you may/may not want this
  2. Create a MIF file of the variable and import only that variable across the book.

Sign up for my (free) Tech Comm Tools community, and I'll send you the relevant MIF section of FrameMaker - Creating and Publishing Content.

-Matt

techcommtools.com

-Matt Sullivan, FrameMaker Course Creator, Author, Trainer, Consultant
Arnis Gubins
Arnis GubinsCorrect answer
Inspiring
March 10, 2017

Expanding on what Matt said about creating a MIF file, it's just a simple text file called a MIF snippet that looks like this:

<MIFFile 14.00>

<VariableFormats

<VariableFormat

   <VariableName `MyBookName'>

   <VariableDef `The title of this book'>

  > # end of VariableFormat

> # end of VariableFormats

Also have a look at this thread, which covers the same topic: Variable to Pull Book Name?

Finally, you could also try Leximation's BookVars. See: http://leximation.com/tools/info/bookvars.php

AixtronAuthor
Inspiring
March 10, 2017

Thank you all,

Everyone has same response at least in the importing part. Appreciate it very much.

After thought, in my case Import will not work because I have other variables such as Chapter Name, where name is changing for every chapter.

I believe, I will have to go MIF route, the way Arnis has described it.

This will be a good short first try for me.

Once again everyone, appreciate your help.

Bob_Niland
Community Expert
Community Expert
March 10, 2017

If only the Variable Definition needs to be changed,

and if no Variables deliberately have different defs in any book files,

then just change it in one book file, and
do an Import > Formats
De-select All

Select Variables

from the defining file.

And yes, this suggests that it's useful to have a consistent policy of making one book file the defining instance of as much stuff as possible.

If, on the other hand, you need to change the Variable name - different problem.