Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Rename styles with Script - Numbering

New Here ,
Jan 18, 2023 Jan 18, 2023

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!

TOPICS
Scripting
249
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 18, 2023 Jan 18, 2023
 
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 19, 2023 Jan 19, 2023
LATEST
var allps = app.activeDocument.allParagraphStyles;
var i = allps.length;
while(i-- && i > 1) { //skip null and basic style
    allps[i].name = (i-1).toString();
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines