Hello, I've recently found this bit of code that finds character styles by name, replaces them and deletes the old style
var myDocument = app.activeDocument;
if (myDocument.characterStyles.item("Title") != null) {
if (myDocument.characterStyleGroups.item("Catalog Styles"). characterStyles.item("title") != null) {
myDocument.characterStyles.item("Title").remove(myDocument.characterStyleGroups.item("Catalog Styles"). characterStyles.item("title"));
I was wondering if anyone could think of a way to define a list of the styles you wouldn't want deleted and delete everything else?