actually i just dug up something to do that very thing. you can just replace your styles/style groups over “title” and “Title” and my style group. For context, this one finds “Title” (no style group), replaces it with “title” (Catalog Styles) and deletes “Title”
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”));
presumably you could do the same thing by replacing the characterStyles.item with something from this page, don't have indesign at home to test it out though:
https://indesignscriptingrefere…..ches-3.htm
Also, if Jongware wrote me another handy script that just removes all the styles that aren't in an array you specify in the script:
https://creativepro.com/for…..aph-styles
hope that helps