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.


TextFrame content problem

Community Beginner ,
Nov 05, 2021 Nov 05, 2021

Copy link to clipboard

Copied

Hi guys.

I have a textFrame and it has a link with 50 characters.

In my document, I have a limit for width so I can just show 30 characters but it's fine.

In the textFrame layer, I can see 50 characters and I'm trying to get it with layerName.content but when I use it, I get just 30characters!

It's realy funny, because im trying to get value from textFrame but..

TOPICS
Scripting

Views

85

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
Enthusiast ,
Nov 05, 2021 Nov 05, 2021

Copy link to clipboard

Copied

Hi Mesmaili, assuming that you have a variable that refers to your textFrame called "myTextFrame', you can use

 

myTextFrame.parentStory.contents

 

This gives you the whole text, even if it's overset and isn't *in* the textframe.

- 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
Community Beginner ,
Nov 05, 2021 Nov 05, 2021

Copy link to clipboard

Copied

thanks @m1b 
I user .word to get all value inside the textFrame.

"contents" just get you a visual contents!

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
Enthusiast ,
Nov 05, 2021 Nov 05, 2021

Copy link to clipboard

Copied

Hi @Mesmaili I'm not sure you understand, or maybe I just don't understand your comment.

In terms of scripting, if the text doesn't fit in a textframe, it really isn't *in* that textframe. However, the textframe has a Story (the parentStory) and *the story* has the complete text.

Anyway, it sounds like you have found a solution. 🙂

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

Copy link to clipboard

Copied

Hi @m1b 

I understand what you mean.

to tell you more about my problem:

I had a textFrame with 20px height. so I can just see one line with this height. but my text was too long and it was a multiple line but my textFrame size was still 20px and cause of design, I could not change the textFrame size.

in this sutuation if you use content method, you will get just value in the first line!

so if you really want to get every words in a textFrame, ".word" can help you.

I attached an image and hope explained good :))

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 ,
Nov 12, 2021 Nov 12, 2021

Copy link to clipboard

Copied

textFrame.parentStory.contents gets you the full red text, as @m1b  said. textFrame.word would throw an error without an index or range. Even textFrame.words.everyItem().contents would only return the visible string (also as a funky array)

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
Enthusiast ,
Nov 14, 2021 Nov 14, 2021

Copy link to clipboard

Copied

LATEST

Hi @Mesmaili, really what you are saying doesn't seem right, but if you've got it working a different way, please post the code and mark your answer as correct so we can all learn.

- 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