How to De-Clutter InDesign Styles, Characters, and Parents across book documents
I couldn't find scripts to reduce the number of character and paragraph styles, and parent pages across multiple documents without reducing unused styles I might need later which were in use in other book documents. I found a few scripts and community posts that would reduce the style or parent page by comparing only within one document at a time. What I couldn't find were scripts to iterate through a set of documents and keep styles or parents in use across all documents and remove the unused across all open documents.
So I tried my hand at authoring scripts with help from an LLM. My goals in these scripts are in context of managing book documents and combining various documents and then reducing clutter. I didn't want to figure out how to iterate through book documents or handle opening and saving a document if it wasn't open already, so I stuck to the documents that are open at the time the script runs.
I wish reducing unused styles and parents across multiple documents was a feature of InDesign.
For those who are better at scripting, here is a link to the github repo where I have my proof of concepts stored. If you believe the scripts can be improved please improve them. I haven't attempted UXP or plugins. It would be nice if these had a better visual workflow.
The general steps of each script are:
- loop through open documents and track which styles or parent pages are in use
- for parent pages, look through parents and track which parents have nested parents applied
- tell the user in an alert which styles are in use
- loop through the open documents again and remove styles or parents that aren't in use in any of the open documents.
My aim in posting to the community is to help any other who might be looking for the same.
