How it Works

Suppose your story (or your entire document) is formatted like this:

At the very beginning, an InDesign document containing “markup notes.”

At this stage, every ‘wannabe footnote’ is enclosed in angle-brackets: <NOTE>. The script also supports two XML-friendly markups: <note>NOTE</note> and <footnote>NOTE</footnote>. You may add your own markup syntax if you have some skills in RegExp speaking. To do this, extend the FOOTNOTE_PATTERNS object declared in the code:

var FOOTNOTE_PATTERNS = {
    "<footnote>NOTE</footnote>" : "<footnote>([^<]+)</footnote>",
    "<note>NOTE</note>" : "<note>([^<]+)</note>",
    "<NOTE>" : "<([^>]+)>",
    };
 

When you run ReFoot.js from the Scripts Panel, you get a pretty primitive dialog box that allows you to select the appropriate pattern from the FOOTNOTE_PATTERNS set:

Select your “note pattern” in the list box.

Then press OK:

That's it!

Limitations

Patterns. — You may need to add more sophisticated patterns to handle special note formats (especially if the notes themselves contain angle-brackets.) When you create your own pattern, keep in mind that the RegExp is interpreted in the InDesign GREP engine and in the JavaScript RegExp layer. You must use capturing parenthesis in order to catch the note ($1) within the global pattern ($0).

Styles. — The current version of ReFoot.js only creates plain text footnotes, so any character style applied within the markup is lost.

(Thanks to Christoph Weis who gave me the idea of this ‘miniscript.’)

• See also: UnFoot.js