Skip to main content
Participating Frequently
September 13, 2013
Question

all text frames FRAME_TO_CONTENT

  • September 13, 2013
  • 1 reply
  • 940 views

Greetings,

The script below that works perfect in Indesign CC to expand all text frames with overset text in a document. I have to work on a project in CS5 now and can't figure out why it won't work.

Please help!

g = app.documents.stories.everyItem().TextFrames.everyItem;

for (i=0; i<g.length; i++)

  g.fit (FitOptions.FRAME_TO_CONTENT);

see below for the error:

This topic has been closed for replies.

1 reply

Inspiring
September 13, 2013

I just tried the first line of your code in InDesign CC, it does not work.

var g=app.documents.stories.everyItem().textFrames.everyItem;

g;

Do you really want all of the text frames for all stories for all open documents?

g=app.documents;

returns a collection

g=app.documents.everyItem();

returns a method

Try the following in InDesign CC and CS5:

var g=app.documents.everyItem().stories.everyItem().textContainers;

g.length;

textContainers returns an array of all text frames within a story thread. Not too sure when it was introduced (5 or 5.5?).

Community Expert
September 14, 2013

I think "textContainers" was introduced with InDesign CS3.

Uwe

Harbs.
Legend
September 15, 2013

Laubender wrote:

I think "textContainers" was introduced with InDesign CS3.

I think that's correct.