Quantcast
Channel: Adobe Community: Message List - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 3715

Re: Replacing all text in book with sample text

$
0
0

Hi Jang,

 

As part of playing with the code, I came up with the following code (took bits and pieces from various posts here on the forum). I saved it as a JSX file and ran in FM - no change whatsoever - it returns "Undefined". If I understand the code correctly, it should do the job. Any idea what I am doing wrong?

 

var pgf = doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;

while(pgf.ObjectValid()){

     var test = pgf.GetText(-1);

     var text, str;

     text = "";

     for (var i=0; i < test.len ; i +=1)

     {
          var str=test[i].sdata.replace(/[abcdefghknopqrsuvyz]/g, "xyz"); 

          text = text + str;

          PrintTextItem (test[i]);

     }                      

     pgf = pgf.NextPgfInFlow;

}

 

Thank you in advance!


Viewing all articles
Browse latest Browse all 3715

Trending Articles



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