Skip to main content
Participant
January 18, 2023
Question

Rename styles with Script - Numbering

  • January 18, 2023
  • 2 replies
  • 232 views

I use this script to rename the styles:

https://github.com/jalbertbowden/indesign-scripting/blob/master/RenameStyles.jsx

 

And it gives me results of ascending geometric numbers.
123, 123456, 1234567, and so on.
I want normal numbering from 1 and up, as many styles as there are.

What do I need to update here, to achieve this result?


Thanks!

This topic has been closed for replies.

2 replies

brian_p_dts
Community Expert
Community Expert
January 19, 2023
var allps = app.activeDocument.allParagraphStyles;
var i = allps.length;
while(i-- && i > 1) { //skip null and basic style
    allps[i].name = (i-1).toString();
}
Participant
January 18, 2023
123456.png