Copy link to clipboard
Copied
Hi Guys,
Output Needed: Have to remove unused character styles from the indesign, in that i have faced a new issue, that the character styles is belongs to bullet and numbering section where i cant able to find over script. then i found a key word to acces the character style used in bullets and numbering "bulletsCharacterStyle". but my code is not working properly. could anyone help on this asap.
I confess, I have no real idea how to make your code work. I learned a very different way to achieve these ends from Jongware:
app.menus.item(“Character Style Panel Menu”).menuItems.item(“Select All Unused”).associatedMenuAction.invoke();
app.menus.item(“Character Style Panel Menu”).menuItems.item(“Delete Styles...”).associatedMenuAction.invoke();
Don't know if it will still work all these years later, but it will respect all charstyles used only in bullet definitions as used. That's what yo
...Copy link to clipboard
Copied
I confess, I have no real idea how to make your code work. I learned a very different way to achieve these ends from Jongware:
app.menus.item(“Character Style Panel Menu”).menuItems.item(“Select All Unused”).associatedMenuAction.invoke();
app.menus.item(“Character Style Panel Menu”).menuItems.item(“Delete Styles...”).associatedMenuAction.invoke();
Don't know if it will still work all these years later, but it will respect all charstyles used only in bullet definitions as used. That's what you're trying to do, right? You're using myDocument.findText() to see if a character style is applied to anything in the document (so you can delete it if unused), but that findText won't find a charstyle used only in a paragraph style, correct? So that's why you're looking specifically for charstyles used in this way?
If I have all that right, then I think you can safely rely on "Select All Unused." If I'm wrong, can you tell me where?
Copy link to clipboard
Copied
Thanks Joel Cherney..
Yes this is the safest way to process on unused styles using invoke options..
I found some other way that reading all the bullet nested styles from all paragraphs and cross check that styles before removing the character styles. its work on.. but its also have some bugs that..incase the bullet nested style created out of paragraph styles(by the manual way) we could not able to catchup..
So i'm also concluded with the invoke option..
And I just wanna share my tested code for the above mentioned way!
//Reading all bullet nested charcter styles from paragraph styles
//looping charcter style and match with the already stored nested bullet styles
Thanks for your help!