Article View: adobe.scripting.indesign
Article #283Re: CS3 JS flag which page has empty frame
From: John_Kordas
Date: Fri, 20 Mar 2009 05:35
Date: Fri, 20 Mar 2009 05:35
28 lines
1660 bytes
1660 bytes
Thanks again Dave,
The select part is working but once selected I not able to effect the frame. Using this:
for (var j = myPages.length - 1; j >= 0; j--) {
if(myPages[j].rectangles.length >= 1 && myPages[j].allGraphics.length > 0 ){
var myGraphic = myDoc.select(myPages[j].rectangles);
myGraphic.rectangle.fit (CENTER_CONTENT)
}
}
var myGraphic = myDoc.select(myPages[j].rectangles);
myGraphic is now the variable that is selected correct?
Now if I want to effect that variable I should be able to do this:
myGraphic.rectangle.fit (CENTER_CONTENT)
but I'm getting the following error.
undefined is not an object.
in past creating the rectangle and changing it using:
var myFrame = pages.item(0).rectangles.add({strokeWeight:0, strokeColor:myDocument.swatches.item("None")});
with(myFrame){
geometricBounds = myGetBounds(myDocument, myPage);
myFile = myFrame.place( File(myFile), false );
app.activeWindow.zoom(ZoomOptions.fitPage);
has worked with no problems. I seem to be having problems manipulating rectangles already created.
Technical Details
Message-ID:
<59b83b3d.4@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossingReferences:
<59b83b3d.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,5f85c25f887dafb2 X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: John_Kordas@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: CS3 JS flag which page has empty frame Message-ID: <59b83b3d.4@webcrossing.la2eafNXanI> Date: Thu, 19 Mar 2009 22:35:11 -0700 References: <59b83b3d.-1@webcrossing.la2eafNXanI> Lines: 32 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit