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

Fill Proportionally all anchored frames to content

Guest
Nov 07, 2009 Nov 07, 2009

Copy link to clipboard

Copied

Hi,

there's a way to Fill all anchored text Frame Proportionally to content  (> 1000 anchored frames)?

Thanks for help

TOPICS
Scripting

Views

1.1K

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
Guide ,
Nov 07, 2009 Nov 07, 2009

Copy link to clipboard

Copied

I'm not sure to understand what you mean by "Fill proportionally to content", but you can fit (anchored text) frames to content:

var isAnchoredTextFrame = function(o)
     {
     if (o.constructor != TextFrame) return false;
     return (o.parent.constructor == Character);
     }

var pItems = app.activeDocument.allPageItems;

while (p=pItems.pop())
     if (isAnchoredTextFrame(p))
          p.fit(FitOptions.frameToContent);

There may be a better way to implement isAnchoredTextFrame(). Our fellow scripters will tell us...

@+

Marc

- - -

http://www.indiscripts.com

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 ,
Nov 07, 2009 Nov 07, 2009

Copy link to clipboard

Copied

The OP might mean

p.fit (FitOptions.FILL_PROPORTIONALLY);

I see nothing wrong with your way of collecting anchored frames 🙂

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
Guide ,
Nov 07, 2009 Nov 07, 2009

Copy link to clipboard

Copied

[Jongware] wrote:

The OP might mean

p.fit (FitOptions.FILL_PROPORTIONALLY);

In a text frame ??

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 ,
Nov 08, 2009 Nov 08, 2009

Copy link to clipboard

Copied

LATEST

Huh. I should've read more than just the title 😛 (After reading the entire post -- guess you're right...)

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
LEGEND ,
Nov 07, 2009 Nov 07, 2009

Copy link to clipboard

Copied

There may be a better way to implement isAnchoredTextFrame(). Our

fellow scripters will tell us...

I think the most direct (and quickest) way is:

app.documents[0].stories.everyItem().textFrames.everyItem();

Harbs

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
Guide ,
Nov 07, 2009 Nov 07, 2009

Copy link to clipboard

Copied

Harbs, you're the best 😉

@+

Marc

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
LEGEND ,
Nov 07, 2009 Nov 07, 2009

Copy link to clipboard

Copied

Aw Shucks!

But don't forget that before CS3, the textFrames of a story were what is now the textContainers...

I think that for it to work in CS2, you had to do:

doc.stories.everyItem().texts.everyItem().textFrames.everyItem();

But my memory might be faulty on the exact working code...

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