ExtendScript: search for any character tag
Dear experts,
I try to find any character format with the following script:
var aLocNames = [], j, jMax, oFindParms, oPgf, sTag, tRange, tRange, zz;
//
tRange = new TextRange();
oPgf = oDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;
tRange.beg.obj = tRange.end.obj = oPgf; // set up the starting TR
tRange.beg.offset = tRange.end.offset = 0;
// Find any character format iFS, iFV, sSearch, iMode, bWord, bCase, bBack (wildcard)
oFindParms = KLD_F.GetFindParameters (5, 0, "*", 1, false, false, false);
KLD_Z.InitFA_errno (); // reset - it is write protected
tRange = oDoc.Find (tRange.beg, oFindParms);// initial find
zz = FA_errno;
oDoc.TextSelection = tRange; // debug: indicate visually
oDoc.ScrollToText(tRange);
$.bp(true);
sTag = tRange.beg.obj; //<<<<<<< How to find the tag name?
aLocNames.push(sTag);
while(FA_errno === Constants.FE_Success) {
tRange = oDoc.Find (tRange.beg, oFindParms);
zz = FA_errno; // debug: 0 OK; -95 not found
oDoc.TextSelection = tRange; // debug: indicate visually
oDoc.ScrollToText(tRange);
$.bp(true);
sTag = tRange.beg.obj; //<<<<<<< How to find the tag name?
aLocNames.push(sTag);
tRange.beg.offset += 1; // to continue search
}Text range is found and highlighted, if script is stopped.
However, tRange.beg.obj is a paragraph object, which does not have a property for the character format.
IMHO I need to do this:
Get the paragraph and search it's parts with textObj.GetText(Constants.FTI_CharPropsChange);
But how t handle the flag Constants.FTF_CHARTAG ?

