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.
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
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?
Copy link to clipboard
Copied
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