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

Get content from Anchored text frame

Contributor ,
Oct 10, 2022 Oct 10, 2022

Copy link to clipboard

Copied

Hi friends,

Please help on this. 

How to get content in the Anchored text-frame from linked footnote element.

My Process: first i need to select footnote element and catch with Anchor text-frame contents.

 

karthikS_0-1665392858977.png

 

Kindly advice on this.

 

Thanks in Advance,

Karthik S

TOPICS
Scripting

Views

99

Likes

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 , Oct 10, 2022 Oct 10, 2022

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 )

 

Likes

Translate

Translate
Community Expert ,
Oct 10, 2022 Oct 10, 2022

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

Likes

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 ,
Oct 10, 2022 Oct 10, 2022

Copy link to clipboard

Copied

Hi Mark,

Thanks! i have attached the indd file for your reference. Kindly check and advice on this.

Likes

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 ,
Oct 10, 2022 Oct 10, 2022

Copy link to clipboard

Copied

LATEST

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]);

 

Likes

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 ,
Oct 10, 2022 Oct 10, 2022

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 )

 

Likes

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 ,
Oct 10, 2022 Oct 10, 2022

Copy link to clipboard

Copied

Hi Uwe,

Thanks lot! this is working fine.

Likes

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