• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Get endnote number

Contributor ,
Jun 13, 2022 Jun 13, 2022

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

268

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 13, 2022 Jun 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

...

Votes

Translate

Translate
Community Expert ,
Jun 13, 2022 Jun 13, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 13, 2022 Jun 13, 2022

Copy link to clipboard

Copied

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

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jun 14, 2022 Jun 14, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 11, 2022 Jul 11, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2022 Jul 11, 2022

Copy link to clipboard

Copied

LATEST

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 )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines