Reply To: Converting Existing Footnotes to End-notes Selectively.

Home Page / Forums / General InDesign Topics (CLOSED) / Converting Existing Footnotes to End-notes Selectively. / Reply To: Converting Existing Footnotes to End-notes Selectively.

#104357
Peter Kahrel
Participant

Interesting. The below script does what you want. An alternative would be to place the sidenotes anchored frames (a variant of https://www.kahrel.plus.com/indesign/sidenotes.html). This alternative requires the set-up of some styles but is probably easier to use in the long run.

Anyway, here’s the script. Select the footnote you want to convert and run the script.

Peter

function () {
  if (app.selection.length && app.selection[0] instanceof Character && app.selection[0].contents == SpecialCharacters.FOOTNOTE_SYMBOL) {
    var sep = app.documents[0].footnoteOptions.separatorText.length;
    var story = app.selection[0].parentStory;
    var n = story.insertionPoints.itemByRange (0, app.selection[0].index).footnotes.length;
    var fnote = story.footnotes[n];
    var ix = fnote.storyOffset.index;
    var enote = fnote.storyOffset.createEndnote();
    // InDesign adds a space after the new endnote, delete it.
    if (story.characters[p+1].contents == ' ') {
      story.characters[p+1].contents = '';
    }
    fnote.characters.itemByRange (0, sep+1).contents = '';
    fnote.texts[0].move (LocationOptions.AFTER, enote.insertionPoints[-1]);
    fnote.remove();
  }
}());

This article was last modified on June 19, 2018

Comments (0)

Loading comments...