Article View: adobe.scripting.indesign
Article #15317Re: AS - drawing a box on the active page?
From: Casey D'Andrea
Date: Mon, 08 Dec 2003 15:12
Date: Mon, 08 Dec 2003 15:12
42 lines
2353 bytes
2353 bytes
Thanks Olav! This is what I have now: set cPageNum to active page of layout window 1 of myDocument set cPageNum to name of cPageNum tell page cPageNum of myDocument set imageTop to item (3) of bounds set imageLeft to item (4) of bounds set imageTop to imageTop - imageTop + 10 set imageLeft to imageLeft - 110 end tell The identifies the active page, then redefines cPageNum as the name which would be "2" if page 2 is the active page. Instead of placing the new box to the right of the active page (which would drop the box on the opposite page), I set the origin of to-be-created frame to be just inside the inside top right of the active page. My next challenge is determining when the value returned is odd or even. The result would then determine whether to place the frame to the left of an odd page, or the right of an even page. How could I check that? Do I run an if statement asking whether cPageNum is divisible by 2? Would it look something like this: set cPageNum to active page of layout window 1 of myDocument set cPageNum to name of cPageNum tell page cPageNum of myDocument if cPageNum is odd then set imageTop to item (3) of bounds set imageLeft to item (4) of bounds set imageTop to 0 set imageLeft to imageLeft imageLeft - 110 else set imageTop to item (3) of bounds set imageLeft to item (4) of bounds set imageTop to 0 set imageLeft to imageLeft + 10 end if end tell I know that odd is not the correct syntax. What would help me determine that? -- Thanks again, Casey
Technical Details
Message-ID:
<2ccec6d8.1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccec6d8.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,129671036175acbc X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-12-08 07:37:51 PST From: "Casey D'Andrea" <kcjones76@cogeco.ca> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: AS - drawing a box on the active page? Message-ID: <2ccec6d8.1@webx.la2eafNXanI> Date: Mon, 8 Dec 2003 07:12:36 -0800 References: <2ccec6d8.-1@webx.la2eafNXanI> Lines: 50 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit