Hi I am in need of a script that when clicked, will open a browse window for you to choose a folder, and once folder is selected, will automatically open all the InDesign files inside, remove character styles and paragraph styles, and preserve all formatting (included nested styles). Paragraph styles should be replaced with None, not Basic. Files would then save and close. I have one right now however the nested styles aren't coming out clean. Essentially if there was a way to make the script look for nested styles on page and convert them to local character styling that would be what's needed. Then deleting the paragraph and character styles and preserving formatting would work. Any help would be great.
Without debating this much deeper:
I don't think, there is a bullet proof solution for your problem, if we consider all possible formatting that can be done with inDesign.
There would be a solution for a lot of documents, but not for all.
Nested styles, GREP Styles and other automatic formatting can introduce conditions, that cannot be controlled entirely by scripting down to making error free predictions how an individual character is formatted.
Just my 2 Euro-Cents.