Removing the unused character style also deletes the bullet
I'm using this script (Kasyan Servetsky) in my documents but character styles in bullets are removed too.
Have any way to preserve in these cases?
var myDoc = app.activeDocument;
var myCharStyles = myDoc.allCharacterStyles;
for (i = myCharStyles.length-1; i >= 1; i-- ) {
removeUnusedCharStyle(myCharStyles);
}
function removeUnusedCharStyle(myChStyle) {
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.appliedCharacterStyle = myChStyle;
var myFoundStyles = myDoc.findText();
if (myFoundStyles == 0 )
{
myChStyle.remove();
}
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
}
I need to preserve character style into paragraph style!
Thanks advice...