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

How to get the text that is inside an anchored text frame

Explorer ,
Feb 10, 2021 Feb 10, 2021

Copy link to clipboard

Copied

Using C++ how can I get the text that is inside an anchored text frame.

I do have the UIDRef of the ancher text frame, but I am not able to get the text inside it.

 

appreciate the help,

Joe

TOPICS
SDK

Views

409

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 Beginner , Feb 12, 2021 Feb 12, 2021

Oops :

InterfacePtr<IHierarchy> iInlineHierarchy(_UIDRef_you_have_, IID_IHIERARCHY);
// The first child is the kSplineItemBoss of the nested text frame
InterfacePtr<IHierarchy> iSplineHierarchy(iInlineHierarchy->QueryChild(0));
// kMultiColumnItemBoss
InterfacePtr<IHierarchy> iMultiColumnItemHierarchy(iSplineHierarchy->QueryChild(0));
// kFrameItemBoss
InterfacePtr<IHierarchy> iFrameItemHierarchy(iMultiColumnItemHierarchy->QueryChild(0));

// I forgot this
InterfacePtr<ITextFrameColumn> iTextFram
...

Votes

Translate

Translate
Community Expert ,
Feb 10, 2021 Feb 10, 2021

Copy link to clipboard

Copied

Please explain more about how you are wanting to access this ? C++ programming language ?

 

What are you trying to achieve with this ?

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
Explorer ,
Feb 10, 2021 Feb 10, 2021

Copy link to clipboard

Copied

I am creating an InDesign PlugIn.

I am looping to get the text inside the anchored text boxes. I am able to get the text inside the parent text frame and identify the anchor text frame itself. However, I am not able to get the text inside the child(anchored) frame.

 

Appreciate the help.

Joe 

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 ,
Feb 11, 2021 Feb 11, 2021

Copy link to clipboard

Copied

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
Explorer ,
Feb 11, 2021 Feb 11, 2021

Copy link to clipboard

Copied

Thank you for your suggestion. I am able to get the list of the inline items in a frame. The issue remains, that I am not able to get the text that is inside the inline item.

 

Appreciate the help,

Joe

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 Beginner ,
Feb 12, 2021 Feb 12, 2021

Copy link to clipboard

Copied

If you have the UIDRef of the inline item then you have to use hierarchy to get the nested text frame :

InterfacePtr<IHierarchy> iInlineHierarchy(_UIDRef_you_have_, IID_IHIERARCHY);
// The first child is the kSplineItemBoss of the nested text frame
InterfacePtr<IHierarchy> iSplineHierarchy(iInlineHierarchy->QueryChild(0));
// kMultiColumnItemBoss
InterfacePtr<IHierarchy> iMultiColumnItemHierarchy(iSplineHierarchy->QueryChild(0));
// kFrameItemBoss
InterfacePtr<IHierarchy> iFrameItemHierarchy(iMultiColumnItemHierarchy->QueryChild(0));
InterfacePtr<IFrameList> iFrameList(iFrameItemHierarchy->QueryFrameList());
InterfacePtr<ITextModel> iTextModel(iFrameList->QueryTextModel());

 

Now, you have the ITextModel of your nested text frame and you can get the text.

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
Explorer ,
Feb 12, 2021 Feb 12, 2021

Copy link to clipboard

Copied

Thank you very much for your help. I have an issue with the following:

InterfacePtr<IFrameList> iFrameList(iFrameItemHierarchy->QueryFrameList())

 

 iFrameItemHierarchy has no member QueryFrameList();

 

Appreciate,

Joe

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 Beginner ,
Feb 12, 2021 Feb 12, 2021

Copy link to clipboard

Copied

Oops :

InterfacePtr<IHierarchy> iInlineHierarchy(_UIDRef_you_have_, IID_IHIERARCHY);
// The first child is the kSplineItemBoss of the nested text frame
InterfacePtr<IHierarchy> iSplineHierarchy(iInlineHierarchy->QueryChild(0));
// kMultiColumnItemBoss
InterfacePtr<IHierarchy> iMultiColumnItemHierarchy(iSplineHierarchy->QueryChild(0));
// kFrameItemBoss
InterfacePtr<IHierarchy> iFrameItemHierarchy(iMultiColumnItemHierarchy->QueryChild(0));

// I forgot this
InterfacePtr<ITextFrameColumn> iTextFrameColumn(iFrameItemHierarchy, IID_ITEXTFRAMECOLUMN);

InterfacePtr<IFrameList> iFrameList(iTextFrameColumn->QueryFrameList());
InterfacePtr<ITextModel> iTextModel(iFrameList->QueryTextModel());

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
Explorer ,
Feb 12, 2021 Feb 12, 2021

Copy link to clipboard

Copied

LATEST

Thank you very much for your help.

That solved the issue!!

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