Copy link to clipboard
Copied
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;
}
}
Have something to add?