Convert footnotes to endnotes

The script converts InDesign footnotes to dynamic endnotes. The notes are placed at the end of the story in which they occur. The endnotes are numbered using InDesign's paragraph number feature; the note references are cross-references linked to the notes. The numbering style used in the endnotes is the same as that set in the footnote options.

To add and delete dynamic notes after you've used the script to convert the notes, see Adding and deleting notes: managing cross-references.

The script works as follows. If a paragraph style is set in the Footnote Option window, the script uses that for the endnotes; if a footnote style has not been set, the script creates a new paragraph style (endnote) and uses that. Similarly, if a character style has been set in the Footnote Option window for the note references, that style is used by the script; if no character style was set, a new character style (endnote_marker) is created for the references. The new style uses the formatting set in the Footnote Option window at Position in the Footnote Reference Number in Text panel.

Because the endnote paragraph style is numbered, the script needs two paragraph styles: one numbered style for the first note, a second style for all subsequent paragraphs in the same note. If you had set a style in the Footnote Option window, say, Footnote Text, the script adds a new style Footnote Text numbered for the first, numbered, paragraph in a note and bases it on Footnote Text. The numbering style (Roman, Arabic, etc.) set in the footnote options is used in the paragraph style for the endnotes.

With nothing selected in the document, the script processes all stories and places the notes at the end of each story. If a story becomes overset you'll need to resolve this manually. To convert the notes in just one story, select one of the story's text frames or just click in that story, then run the script.

Use

The script has no interface. Open the document that contains the notes you want to convert and run the script.

Notes

1. If it's not possible to convert a story's footnotes to endnotes, then add more footnotes to the same story and run the script again. You can run the script again only if all the footnotes are in a separate story. Then you can select that story and run the script.

2. The script described here is for single documents only, or for end-of-chapter notes in a book. For end-of-book notes, see here.


Return links

The cross-references created by the script create hyperlinks from the note reference to the endnote. But these are one-way links. To create return links (in e.g. Epubs) you need an additional script (it's linked below).

To add the return links, run the script. You're prompted to select the character style used for the note references and the paragraph style applied to the notes. You can see the result in the Hyperlinks panel, and you can test the results there.

WARNING

The return linker needs the note numbers as literal text so that there's something to highlight. To this end, the script converts the automatic paragraph numbers to plain text. You must therefore save your text before you add the return links. The script displays a warning to remind you.

So the approach is as follows: complete the job and save it (and take a copy to be on the safe side); add the return links; export to Epub, PDF, etc.; discard the document. Do not save the document after adding the return link. You're warned.


Version history

12 Apr. 2017: Added a reminder to the return linker that it is a destructive script.

7 Mar. 2017: Added the return linker.

6 May 2015: updated the script to deal with a changed default in InDesign CC.

14 Aug. 2014: for the numbers in the endnotes, the script now uses the numbering style (Arabic, Roman, etc.) set in the footnote options.

12 Nov. 2012: (1) trailing returns in footnotes created problems during the conversion: fixed; (2) the script now tries to use the current footnote character and paragraph styles if they're in the document.

23 Jan. 2012: endnote numbering didn't always start at 1 (usually because of existing numbered lists); fixed. The script now also removes story-trailing white space and inserts a heading "Notes" between the text and the notes.

14 June 2010: added support for multiple stories and multiple paragraphs per note. (Thanks to Martin Fischer for pointing out the shortcoming.)


Useful script? Saved you lots of time?

Consider making a donation. To make a donation, please press the button below. This is Paypal's payment system; you don't need a Paypal account to use it: you can use several types/brands of credit and debit card.

Peter Kahrel's paypal account

Footnote-to-endnote script -- to download, right click, then Save Link/Target As

Return-links script -- to download, right click, then Save Link/Target As


Back to note page

Back to script index

Installing and running scripts

Questions, comments? Get in touch