Article View: adobe.scripting.indesign
Article #814Re: script request
From: Kasyan_Servetsky
Date: Wed, 04 Mar 2009 18:33
Date: Wed, 04 Mar 2009 18:33
22 lines
1477 bytes
1477 bytes
Hi Lorna,
I assume that one box is selected in the current document. But there is not enough information in your post: which box should be transformed – graphic/text frame, only selected frame or all on the page /spread/ in document etc.
Kasyan
if (app.selection.length > 0) {
var mySelection = app.selection[0];
}
else {
alert("Select a box.");
exit();
}
var myBounds= mySelection.geometricBounds;
var myWidth = myBounds[3] - myBounds[1];
var myHeght = myBounds[2] - myBounds[0];
var myHorScaleFactor = (myWidth + 0.125)/myWidth;
var myVerScaleFactor = (myHeght + 0.125)/myHeght;
var myTransformationMatrix = app.transformationMatrices.add({horizontalScaleFactor:myHorScaleFactor, verticalScaleFactor:myVerScaleFactor});
mySelection.transform(CoordinateSpaces.PASTEBOARD_COORDINATES, AnchorPoint.CENTER_ANCHOR, myTransformationMatrix);
Technical Details
Message-ID:
<59b81d1a.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossingReferences:
<59b81d1a.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,20b482460be056c2 X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Kasyan_Servetsky@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: script request Message-ID: <59b81d1a.0@webcrossing.la2eafNXanI> Date: Wed, 4 Mar 2009 10:33:15 -0800 References: <59b81d1a.-1@webcrossing.la2eafNXanI> Lines: 19 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit