Skip to main content
Inspiring
July 19, 2023
Answered

Restarting end note numbering

  • July 19, 2023
  • 2 replies
  • 523 views

Is there an easy way to restart endnote numbering for each chapter when a style is applied? I would like the numbering for endnotes to restart from 1 when I use the paragraph style Chapter Title. It is a pain having to split the book into chapters, or split the text flow into stories as I have books in one file. I can do it with footnotes by restarting each section then manually renumbering each section start - but nothing like this with endnotes.

This topic has been closed for replies.
Correct answer Peter Kahrel

And then I remembered that I did one of those a while ago.  First make sure you have a copy of your file. Then if you want to split your story on instances of the paragraph style Chapter Title, place your cursor in such a paragraph, then run the script. It has no interface.

 

//DESCRIPTION: Split a story on the selected paragraph style

(function () {

  var styleName = app.selection[0].appliedParagraphStyle.name;
  var story = app.selection[0].parentStory;
  var p = story.paragraphs.everyItem().getElements();
  var frame;

  for (var i = p.length-1; i >= 1; i--) {
    if (p[i].appliedParagraphStyle.name === styleName) {
      frame = p[i].parentTextFrames[0];
      frame.previousTextFrame = null;
      story.insertionPoints.itemByRange (p[i].index, story.length)
        .move (LocationOptions.AFTER, frame.insertionPoints[0]);
    }
  }

}());

 

2 replies

Peter KahrelCorrect answer
Adobe Expert
July 19, 2023

And then I remembered that I did one of those a while ago.  First make sure you have a copy of your file. Then if you want to split your story on instances of the paragraph style Chapter Title, place your cursor in such a paragraph, then run the script. It has no interface.

 

//DESCRIPTION: Split a story on the selected paragraph style

(function () {

  var styleName = app.selection[0].appliedParagraphStyle.name;
  var story = app.selection[0].parentStory;
  var p = story.paragraphs.everyItem().getElements();
  var frame;

  for (var i = p.length-1; i >= 1; i--) {
    if (p[i].appliedParagraphStyle.name === styleName) {
      frame = p[i].parentTextFrames[0];
      frame.previousTextFrame = null;
      story.insertionPoints.itemByRange (p[i].index, story.length)
        .move (LocationOptions.AFTER, frame.insertionPoints[0]);
    }
  }

}());

 

Adobe Expert
July 19, 2023

No easy way, you're stuck with restart at every story. It's possible to do a script that hides the automatic numbering and inserts static numbers (bith the note number and the note's reference), but it's flunky and you need to rerun it when you add or remove notes. I'm not aware that such a script exists.

 

It's reaaly much simpler to split your document into seperate stories. There are scripts around that do that. Google around and you should find something.