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

textFrame.frameFittingOptions in indesign cs5

New Here ,
Mar 15, 2011 Mar 15, 2011

Copy link to clipboard

Copied

Hi:

   In indesign cs4, it works with textFrame.frameFittingOptions,

   but in indesign cs5 it said: Object does not support the property or method 'frameFittingOptions'

   Does anybody knows what i have to change to let it work in CS5?

   Thanks in advance.

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
Community Expert ,
Mar 15, 2011 Mar 15, 2011

Copy link to clipboard

Copied

Hi, try below code.

app.activeDocument.selection[0].fit(FitOptions.FRAME_TO_CONTENT);

You can read "fitOptions" in OMV for more detail.

Still, we are ALIVE...

Ten wrote

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
New Here ,
Mar 15, 2011 Mar 15, 2011

Copy link to clipboard

Copied

How can I set topCrop of frameFittingOptions

In Indesign CS4

     textFrame.frameFittingOptions.topCrop = '10'.

How Can I do this in Indesign CS5?

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 ,
Mar 15, 2011 Mar 15, 2011

Copy link to clipboard

Copied

LATEST

You have to change frames contentType, when you want to set frameFittingOptions.

textFrames[0].contentType = ContentType.graphicType;

But script system can't detect change objects contentType.
However, we can use getElements method.

myFrame = app.activeDocument.textFrames.add();
myFrame.contentType = ContentType.graphicType;
myFrame.getElements()[0].frameFittingOptions.topCrop = 10;

I think that put image into frame, using rectangle is better way.

//sample, Image placement test
//crop top and left
var pageobj = app.activeDocument.pages[0];
var imgobj = pageobj.rectangles.add();
imgobj.visibleBounds = [0,0,200,200];
f = new File ("~/test.eps");
imgobj.place(f);
imgobj.frameFittingOptions.leftCrop = 10;
imgobj.frameFittingOptions.topCrop = 10;
imgobj.fit(FitOptions.APPLY_FRAME_FITTING_OPTIONS);


Ten wrote

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