Copy link to clipboard
Copied
Hi @karthikS ,
if you get the footnote text you can access all text frames in that text and then get the contents or the formatted text inside the anchored text frame. In dummy code, variable myFootnote below should contain a footnote object, for the first text frame in the footnote text:
myFootnote.texts[0].textFrames[0].parentStory.contents
or all formatted text:
myFootnote.texts[0].textFrames[0].parentStory
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Hi @karthikS, in cases like this, it is always helpful to attach a sample indesign document. It can be just one page with the footnote and anchored text frame. It will make it easier and quicker for people to help. - Mark
Copy link to clipboard
Copied
Hi Mark,
Thanks! i have attached the indd file for your reference. Kindly check and advice on this.
Copy link to clipboard
Copied
Hi @karthikS, here is my approach. @Laubender your way is very simple. Maybe I am overthinking it?
- Mark
var doc = app.activeDocument;
// find all anchors
app.findGrepPreferences = NothingEnum.NOTHING;
app.findGrepPreferences.findWhat = '~a';
var found = doc.findGrep();
// discard any anchors without the xml tag 'footnote'
for (var i = found.length - 1; i >= 0; i--)
if (found[i].associatedXMLElements[0].markupTag.name != 'footnote')
found.splice(i, 1);
// get the anchored text frames contents
var anchoredContents = [];
for (var i = 0; i < found.length; i++)
anchoredContents.push(found[i].textFrames[0].contents);
// now you have each contents
alert(anchoredContents[0]);
alert(anchoredContents[1]);
Copy link to clipboard
Copied
Hi @karthikS ,
if you get the footnote text you can access all text frames in that text and then get the contents or the formatted text inside the anchored text frame. In dummy code, variable myFootnote below should contain a footnote object, for the first text frame in the footnote text:
myFootnote.texts[0].textFrames[0].parentStory.contents
or all formatted text:
myFootnote.texts[0].textFrames[0].parentStory
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Hi Uwe,
Thanks lot! this is working fine.