Answered
How to find text with appliedCharacterStyle inside CharacterStyleGroup?
var doc = app.activeDocument;
var doc_allParaStyles = doc.allParagraphStyles;
for(var p = 0 ; p < doc_allParaStyles.length ; p++){
var AllNestedStyles = doc_allParaStyles[p].nestedStyles;
for(var n=0; n<AllNestedStyles.length;n++){
var NestedStyleName=AllNestedStyles[n].appliedCharacterStyle.name;
app.findTextPreferences = NothingEnum.nothing;
app.findTextPreferences.appliedCharacterStyle = NestedStyleName;
//here how to find text with aplliedCharacterStyle inside characterStyleGroups!
var found_txt = app.activeDocument.findText();
app.findTextPreferences = NothingEnum.nothing;
for(var a =0 ; a < found_txt.length ; a++)
{
var foundCon = found_txt[a].contents;
}
}
}In the above code, when I try to find any characterStyleName inside the characterStyleGroup, it is shows following error:
Error: Invalid value for set property 'appliedCharacterStyle'. Expected String, CharacterStyle or NothingEnum enumerator, but received "c4H".
Is there anyother way to find with allCharacterStyles (including groups)!
