Article View: adobe.scripting.indesign
Article #9820Re: [Mac Indesign CS2 JS] add rectangle as big as the page
From: Revier_Daniel
Date: Tue, 18 Jul 2006 17:53
Date: Tue, 18 Jul 2006 17:53
19 lines
1528 bytes
1528 bytes
Not a good one, but it works:
if(app.documents.length > 0){
var myDoc = app.activeDocument;
var bounds = new Array();
bounds[0] = 0;
bounds[1] = 0;
bounds[2] = myDoc.documentPreferences.pageHeight;
bounds[3] = myDoc.documentPreferences.pageWidth;
//Rectangle fit to Page
myDoc.pages[0].rectangles.add({geometricBounds: bounds, strokeWeight: 1, strokeColor: "Black", fillColor: "None"});
//Add 4 Guides
myDoc.guides.add({orientation: HorizontalOrVertical.horizontal, location: 2});
myDoc.guides.add({orientation: HorizontalOrVertical.horizontal, location: myDoc.documentPreferences.pageHeight-2});
myDoc.guides.add({orientation: HorizontalOrVertical.vertical, location: 2});
myDoc.guides.add({orientation: HorizontalOrVertical.vertical, location: myDoc.documentPreferences.pageWidth -2});
}else{
alert("No document open!");
}
Technical Details
Message-ID:
<3bc0f435.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.musoftware.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossingReferences:
<3bc0f435.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,9f82f6293d15dcff X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Revier_Daniel@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Re: [Mac Indesign CS2 JS] add rectangle as big as the page Message-ID: <3bc0f435.0@webcrossing.la2eafNXanI> Date: Tue, 18 Jul 2006 10:53:34 -0700 References: <3bc0f435.-1@webcrossing.la2eafNXanI> Lines: 24 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.musoftware.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing