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
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
...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.
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
Copy link to clipboard
Copied
Hi @tmmls
Just a quick note to mention that Endnote/Footnote numerals can be accessed from the IdExtenso framework:
If you don't use IdExtenso, the underlying algorithms used to decipher numerals are still available here:
Dom.FootEndnote/$$.common.jsxinc
Best,
Marc
Copy link to clipboard
Copied
Hi Marc, Thank you for sharing your feedback. This is very usefull.
Copy link to clipboard
Copied
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 )