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!