Problem with oFrame.NextAFrame
Dear friends,
This time I wanted just to go through the anchored frames in a document. The document contains at least 25 of them and all have a User String.
I fail with getting the next object with property NextAFrame.
The following script just lists the current frame from which I start. I list also H in case ther is no User String.
// TraverseFrames.jsx 2019-05-27
#target framemaker
TraverseFrames();
function TraverseFrames() {
var oFrame, oObject, oDoc=app.ActiveDoc;
$.bp(true);
oObject = oDoc.FirstSelectedGraphicInDoc;
if (!oObject.ObjectValid()) {
$.writeln ("No or invalid object is selected.");
return;
}
if (oObject.constructor.name == "AFrame") {
oFrame = oObject;
$.writeln(oFrame.UserString + " H= " + oFrame.Height);
oFrame = oFrame.NextAFrame;
while (oFrame.ObjectValid()) {
$.writeln(oFrame.UserString + " H= " + oFrame.Height);
oFrame = oFrame.NextAFrame;
}
}
} //--- end TraverseFrames
Where is the knot in my brain?
Klaus

