Skip to main content
SuzzyFlamingo
Inspiring
February 7, 2026
Question

Need help with script or other solution

  • February 7, 2026
  • 3 replies
  • 46 views

Hi, Dear Friends!

I see ID puts all endnotes from all stories in the same text frame at the end of the doc. I am Ok with that but I would like each EN to show “where it is coming from”

So if the EN was inserted in text fram “foo1” it should insert and endnote witht refernce number folowed by the text “foo1” and look like this:

  1. [foo1] here i write the endnote.
  2. [foo5] here i write another end note

I asked ChatGPT and Grok for help and the totally failed.

All help is appreciated!

Thank you, and have a good day!
Susan Flamingo

    3 replies

    Peter Kahrel
    Community Expert
    Community Expert
    February 8, 2026

    > So if the EN was inserted in text frame “foo1”

    What is ‘foo1’ -- the name of the frame on the Layers panel?

    SuzzyFlamingo
    Inspiring
    February 8, 2026

    I was told to give the name in the script label dialog. Is that the same? For ag enius like you this should be nothing to write a scipt fo this? Right?

    Peter Kahrel
    Community Expert
    Community Expert
    February 8, 2026

    Well, never assume that a script will be a doddle. But in this case it’s pretty straightforward.

    After the script ran, check whether any notes didn’t get a frame reference. A miising frame reference means (most probably) an end note reference in overset text.

    (function () {
    var pos = app.activeDocument.endnoteOptions
    .endnoteSeparatorText.length+1;

    var en = app.activeDocument.stories.everyItem()
    .endnotes.everyItem().getElements();

    for (var i = en.length-1; i >= 0; i--) {
    try {
    en[i].insertionPoints[pos].contents =
    '[' + en[i].storyOffset.parentTextFrames[0].label + '] ';
    } catch (_) {
    }
    }
    }());

     

    Mike Witherell
    Community Expert
    Community Expert
    February 8, 2026

    A complicated workaround here:

     

    Mike Witherell
    FRIdNGE
    Inspiring
    February 7, 2026

    Try Claude, Deepseeck, Kimi …