flatten conref in framescript

Community Beginner ,
Nov 25, 2020

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;
}
}

Views

26

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Have something to add?

Join the conversation