Quantcast
Channel: Adobe Community : All Content - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 888

How could I add Existing Variables into a Paragraph using ExtendScripts?

$
0
0

Hi,

 

Based on a specific paragraph tag, I would like to add an existing variable (Name and Fmt) as part of the paragraph's text. I am able to add strings as part of paragraph texts at the moment.

 

I was looking up extend scripts to do this, however I am quite not sure how to add a variable. I could only find instances of updating variable values and so on.

 

Any help would be appreciated.

 

Giving a brief overview of my intention: (For example; Variable = "Part Number: 0x404"

 

                            var newpgf = doc.NewSeriesObject(Constants.FO_Pgf, pgf);

                            var attribute= doc.GetNamedObject(Constants.FO_VarFmt, "Variable");

           

                            var textLoc = new TextLoc();

                            textLoc.obj = newpgf;

                            textLoc.offset = -1;

 

 

                         

                                                               doc.AddText(textLoc, "( ");

                                                                         

Something like this:                            -> doc.AddText(textLoc, attribute.Fmt);       // Not Sure how to do this, possibly link the variable text range to this Text Location?

                                                               doc.AddText(textLoc, " )");               

 

Expected Paragraph:

                                             <Previous Para>

          new Para:                    (Part Number: 0x404 )

 

 

 

Thanks,
Sebin


Viewing all articles
Browse latest Browse all 888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>