Skip to main content
Inspiring
June 13, 2022
Answered

Get endnote number

  • June 13, 2022
  • 3 replies
  • 678 views

Hi,

 

Does anyone know how to get the endnode number/letter used in the main text? This can be a number, letter, ...

 

 

        var myDoc = app.activeDocument;
        var stories = myDoc.stories.everyItem().getElements();

        for (var i = stories.length - 1; i >= 0; i--) {

            var myStory = stories[i];

            for (var j = 0; j < myStory.endnotes.length; j++) {
                  var myNote = myStory.endnotes[j];

                  var endnoteText = myNote.texts[0].contents;
                  var endnoteIndex = myNote.index;
                  //var endnoteNumber = myNote; //??

                  $.writeln("endnote text: " + endnoteText);
                  $.writeln("endnote index: " + endnoteIndex);
                  //$.writeln("endnote number: " + endnoteNumber);
            }
        }

 

 

Thanx

This topic has been closed for replies.
Correct answer Peter Kahrel

Unfortunately, unlike automatic paragraph numbering and text variables, there's no way reliably t obtain a footnote number as plain text (same goes for endnotes). If the 'numbers' are Arabic numbers you can use the for-loop counter to enumerate them -- though you'll have to take into account that numbering can restart in each story. If the 'numbers' are letters it gets trickier, you'll have to convert the counter values to numbers. And if the notes are numbered with symbols you'll have you hands full.

 

Join the masses at https://indesign.uservoice.com to add your voice to the requests to expose footnote and endnote numbers.

3 replies

Community Expert
July 11, 2022

Hi @tmmls ,

apart from Marc's framework I see a chance to extract the value for the endnote and footnote references by exporting to HTML.

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Marc Autret
Legend
June 14, 2022

Hi @tmmls 

 

Just a quick note to mention that Endnote/Footnote numerals can be accessed from the IdExtenso framework:

$$.Dom.Endnote

$$.Dom.Footnote

 

If you don't use IdExtenso, the underlying algorithms used to decipher numerals are still available here:

Dom.FootEndnote/$$.common.jsxinc

 

Best,

Marc

tmmlsAuthor
Inspiring
July 11, 2022

Hi Marc, Thank you for sharing your feedback. This is very usefull. 

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
June 13, 2022

Unfortunately, unlike automatic paragraph numbering and text variables, there's no way reliably t obtain a footnote number as plain text (same goes for endnotes). If the 'numbers' are Arabic numbers you can use the for-loop counter to enumerate them -- though you'll have to take into account that numbering can restart in each story. If the 'numbers' are letters it gets trickier, you'll have to convert the counter values to numbers. And if the notes are numbered with symbols you'll have you hands full.

 

Join the masses at https://indesign.uservoice.com to add your voice to the requests to expose footnote and endnote numbers.

tmmlsAuthor
Inspiring
June 13, 2022

Hi Peter,

Thank you very much for your detailed answer. Much appreciated. 

I will certainly post it on the forum. But I have little to no hope it will change anything. In my experience, the last decade little to nothing has changed on many Adobe applications...

But again, many thanks.

Tm