Why Endnotes are so broken in DOM / Scripting ...
Anyone knows why Endnotes are so broken ?
Footnotes - are available for all Text objects:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Footnotes.html
Object of
Cell.footnotes
Table.footnotes
Text.footnotes
Character.footnotes
Word.footnotes
Line.footnotes
TextColumn.footnotes
Paragraph.footnotes
TextStyleRange.footnotes
InsertionPoint.footnotes
TextFrame.footnotes
Story.footnotes
EndnoteTextFrame.footnotes
XmlStory.footnotes
But Endnotes:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Endnotes.html
Object of
Cell.endnotes
Table.endnotes
InsertionPoint.endnotes
Story.endnotes
XmlStory.endnotes
So you can't iterate through Paragraphs and their Endnotes directly.
Another strange thing - I can't iterate through Story declared in VB as InDesign.Story - I need to declare it as a Variant - otherwise, if I try to iterate through Endnotes of the Story - I get Misatch error stright away on:
For c = 1 To myLStory.Endnotes.Count
But I can iterate through Footnotes without a problem.
Then, I can't declare Endnote as InDesign.Endnote - I also need to declare it as a Variant.
Dim myLEndnote As Variant ' InDesign.Endnote
Dim myLStory As Variant ' InDesign.Story
And on top of that - I can't store a reference to it directly:
Set qqq = myLEndnote
I need to save extra reference to the .ParentStory to be able to "find" footnote using .ItemByID
(end of rant)
