ExtendScript doesn't recognize variables passed to doc.NewAnchoredFormattedVar (b_var, textLoc) !

New Here ,
Apr 03, 2017 Apr 03, 2017

Copy link to clipboard

Copied

Hi all,

I am currently developing a script that automates the addition of new paragraph text comprising variables and string. b_user_input is the the variable name defined in framemaker which is input by the user. However doc.NewAnchoredFormattedVar is not able to recognize the same and prints nothing in the document. Then I tried putting the input string within quotes thinking it might work, but that didn't work too(i.e.  var  b_var = "\""+ffFmt.Name+"\"";

                                                 

          var bbFmt = doc.GetNamedObject (Constants.FO_VarFmt, b_user_input);   //b_user_input = "Variable_b"

          var  b_var =bbFmt.Name;

          doc.AddText (textLoc, "Var_b value: ");

          doc.NewAnchoredFormattedVar (b_var, textLoc);      //       doc.NewAnchoredFormattedVar ("Variable_b", textLoc);  This method works.

It would be great if you could let me know how to make this work.      

Thanks,

Sebin                          

TOPICS
Scripting

Views

143

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
community guidelines
New Here ,
Apr 03, 2017 Apr 03, 2017

Copy link to clipboard

Copied

LATEST

Please ignore my query above. The variables weren't being updated correctly beforehand due to the way the script was being invoked.

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
community guidelines