Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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

177

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 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...

Likes

Translate

Translate
Adobe Community Professional ,
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 ?

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
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 

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

Copy link to clipboard

Copied

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
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

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 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.

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
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

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

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

Copy link to clipboard

Copied

LATEST

Thank you very much for your help.

That solved the issue!!

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