🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18172

Re: MakeGuidesByPercentage problem

#18172
From: Kari Puikkonen
Date: Thu, 17 Apr 2003 07:57
38 lines
2241 bytes
Olivier,

Thanks, it was my sloppy fingers that made that error!

Now I can make guides, but all in my scripts they are created in wrong place(s), also in this new, simpler one:



set myXPercentages to {25, 50, 75} 
--Enter the vertical locations you want as percentages in the following list.  
set myYPercentages to {25, 50, 75} 
tell application "InDesign 2.0.2" 
	set myDocument to make document 
	tell myDocument 
		set myPage to page 1 
		set myPageHeight to page height of document preferences of myDocument 
		set myPageWidth to page width of document preferences of myDocument 
		set myMarginPreferences to margin preferences of myPage 
		set theLiveWidth to myPageWidth - (margin left of myMarginPreferences) - (margin right of myMarginPreferences) 
		set theLiveHeight to myPageHeight - (margin top of myMarginPreferences) - (margin bottom of myMarginPreferences) 
		tell page 1 of myDocument 
			repeat with myGuidePercent in myXPercentages 
				set myGuide to make guide with properties {orientation:vertical, location:(myGuidePercent * 0.01) * theLiveWidth} 
			end repeat 
			repeat with myGuidePercent in myYPercentages 
				set myGuide to make guide with properties {orientation:horizontal, location:(myGuidePercent * 0.01) * theLiveHeight} 
			end repeat 
		end tell 
	end tell 
end tell



So, this seems to be mathematical problem...

(Yes, I know this can be easily made with UI, but I wanted learn to fix that myGetPageBounds handler for my purposes.)

Kari
Technical Details
Message-ID: <1de8b795.3@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de8b795.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,bdb611021b292e3b
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-04-17 01:08:07 PST
From: "Kari Puikkonen" <kari.puikkonen@welho.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: MakeGuidesByPercentage problem
Message-ID: <1de8b795.3@WebX.la2eafNXanI>
Date: Thu, 17 Apr 2003 00:57:27 -0700
References: <1de8b795.-1@WebX.la2eafNXanI>
Lines: 41
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit