> 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.