Renaming a style in the Paragraph panel will automatically rename it everywhere it's used.
styles = app.activeDocument.allParagraphStyles; for (i=2; i<styles.length; i++) styles[i].name = String(i-1);
1 person found this helpful
> Just for the record: this may be scripted with a predefined list instead of numbers?
Sure. If you provide a list of names, the script can assign the first name to the first style, etc. Add something like this (untested) at the top
var names = ["jw", "marc", "loic", "peter", "peter 2", "peter 3"];
and then use
styles[i].name = names[i-2];
You should take care the list of names is long enough to re-name *all* of your styles, or else the script will stop with an error.