Skip to main content
sebinkur
Known Participant
April 3, 2017
Question

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

  • April 3, 2017
  • 1 reply
  • 284 views

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                          

This topic has been closed for replies.

1 reply

sebinkur
sebinkurAuthor
Known Participant
April 3, 2017

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