Skip to main content
andranika45761163
Known Participant
November 25, 2020
Question

flatten conref in framescript

  • November 25, 2020
  • 0 replies
  • 114 views

Hi 

 

do you know how can I flatten conref in framescript, I have it in extendscript - can you convert it to framescript ?

 

function flattenConref(oDoc) {
var oConref = oDoc.FirstTiInDoc;
while (oConref.id != 0) {
var oNextConref = oConref.NextTiInDoc;
var tloc = oConref.TextRange.beg;
var eloc = oDoc.TextLocToElementLoc(tloc);
var oElem = eloc.child;

oConref.ConvertToText();
var lElemAttributes = oElem.Attributes;
var i = 0;
while (i < lElemAttributes.length) {
if (lElemAttributes[i].name == "conref") {
lElemAttributes[i].values[0] = "";
oElem.Attributes = lElemAttributes;
break;
}
i++;
}
oConref = oNextConref;
}
}

    This topic has been closed for replies.