FrameMaker - ExtendScript Writing text to console
Hello
I am trying to create an ExtendScript that takes contents from a FrameMaker document and write it to the Console in the first instance:
This is my attempt:
var doc = app.ActiveDoc;
var firstPgf = doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;floop(firstPgf);
function floop(Pgf){
while(Pgf){
var pgfText = Pgf.GetText(Constants.FTI_String);
Pgf=doc.MainFlowInDoc.FirstTextFrameInFlow.NextPgf;
for(var i=0; i<pgfText.length;i++){
$.writeln(pgfText[i]);
}
$.writeln(pgfText);
}
}
------
The output I get is:
[object TextItem]
Result: undefined
[object TextItem]
[object TextItem]
[object TextItem]
[object TextItem]
[object TextItem]
[object TextItem],[object TextItem],[object TextItem],[object TextItem],[object TextItem]
Result: undefined
The object instances returned seem to be empty or not read at all.
Can you advise?
Thanks
