🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #16842

Re: [VBScript] How does moveTo work?

#16842
From: Olav Kvern
Date: Thu, 31 Jul 2003 07:33
36 lines
2113 bytes
Alex--

The trouble is that we can't reliably get individual values from GeometricBounds until it's cast into a variable. So:



myBounds = myFrame.GeometricBounds 
myY1 = myBounds(0)  
myX1 = myBounds(1)  
Rem ... and so on 




Next, get in the habit of applying a small moveBy move immediately after you create an page item which might have a stroke weight greater than 0 (rectangles, ovals, polygons, and lines qualify). Why? It's because InDesign considers the left-most page in a spread that touches the page item to be the parent of that page item.

Imagine that you have a two page spread, and your ruler origin is set to page origin. You then tell the right-hand page to create a rectangle. When you set the geometric bounds of the rectangle, it'll move to the left-hand page of the spread, because its stroke touched that page, and all measurements are based on the upper-left corner of that page.

So, whenever I'm creating page items that might appear on a spread, I try to remember to "bump" then onto the page.



Set myRectangle = myPage.Rectangles.Add 
myRectangle.Move , Array(1, 1) 
Rem myRectangle.GeometricBounds = ...and so on 




This clears up any possible page ownership confusion.

(Good one, Max, by the way! Thanks for your contributions to the forum.)

Thanks,

Ole
Technical Details
Message-ID: <1dea22ed.3@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!peer2.news.opaltelecom.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1dea22ed.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,7f15b4c91645e124
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-07-31 00:37:57 PST
From: "Olav Kvern" <okvern@adobe.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!peer2.news.opaltelecom.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: [VBScript] How does moveTo work?
Message-ID: <1dea22ed.3@WebX.la2eafNXanI>
Date: Thu, 31 Jul 2003 00:33:46 -0700
References: <1dea22ed.-1@WebX.la2eafNXanI>
Lines: 39
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit