IndexMatic² and End Notes
March 14, 2019 | IndexMatic² | en | fr
Maybe you now use InDesign endnotes, and maybe you would like to capture and index strings found in this area. Alas! IndexMatic² has no endnote-related option. It just lets you include or exclude footnotes. Does this mean it won't scan endnotes at all?…
An endnote text appears in a new frame (the endnote frame) at the end of the document or attached story. For the time being, IndexMatic² does not manage this CC component. In the above example, the endnote frame (page 124) is in principle beyond the reach of the script.
So if you select the option Footnotes: All and run a query intended to capture some words in this French document —say /route|mer|marin|trésor|coffre/
—
then IndexMatic² retrieves all it can from both the story and its footnotes, but nothing comes up from page 124, as shown below.
However —call it a bug or a happy side effect!— there is a funny thing: tell IndexMatic² to ignore anchored/inline blocks,
and re-run your query in the same conditions. Now both footnotes (page 123) and endnotes (page 124) are scanned and reported in the index:
There is no apparent link between anchored frames and endnote frames. (And in fact, there is no obscure link either!) This hidden access to endnotes is a pure accident, related to a technical optimization of the script:
a. In case IndexMatic² is told to ignore anchored objects, it scans pages using a fast instruction — page.textFrames.everyItem()
— which allows it to skip a critical test. Namely, it no longer has to check whether the considered object is a TextFrame
instance. Luckily, endnote frames essentially work as basic text frames and are properly listed in the TextFrames
collection of a page. So IndexMatic² will treat those foreign objects as if they were regular text containers :-)
b. Conversely, when IndexMatic² needs to explore anchored objects as well a regular frames, it uses a different strategy, based on the allPageItems
collection. Then it filters out any component which is not a pure TextFrame
, based on an explicit test of the form (myObj instanceof TextFrame)
. Then, EndnoteTextFrames
are ignored :-(
This trick cannot deal with any document structure though. In particular, I have assumed that you don't want to capture text in actual anchored frames!