🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18364

Strange Applescript bug

#18364
From: John Darnell
Date: Wed, 02 Apr 2003 20:29
44 lines
2157 bytes
Hello fellow scripters:

I have this script I have written:

			set MyDocPrefs to document preferences
			tell MyDocPrefs

				set PageParamList to my GetPageMeasurements(PageSize)

				set pw to item 1 of PageParamList
				set ph to item 2 of PageParamList

				--set page width to item 1 of PageParamList
				--set page height to item 2 of PageParamList

				set page width to pw
				set page height to ph

				set pages per document to 1
				set page orientation to portrait
			end tell --MyDocPrefs

The GetPageMeasurements() handler searches through a bunch of if statements and returns a page width and height in that order. Here's the code:



	if PageSize = "3" then
		set PageParamList to {"33p", "51p"}
	end if
[Lots of identical-looking code deleted]

	if PageSize = "10" then
		set PageParamList to {"62.5p", "56p"}
	end if

	return PageParamList

end GetPageMeasurements

If I ask for the page width and height of Page size 10, it returns the correct measurements, but when I put them in the "page width" and "page height" properties of document preferences, *for page size 10 only* the width and height values get switched. I have run through all the other page sizes, and they work just fine. It is only page size 10 that does not work properly.

Does anyone see where I have gone wrong?

Signed Green and Glowing (aka John Darnell)
Technical Details
Message-ID: <1de891e1.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,3cd7114bfb338494,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-04-02 12:39:01 PST
From: "John Darnell" <John.Darnell@Walsworth.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Strange Applescript bug
Message-ID: <1de891e1.-1@WebX.la2eafNXanI>
Date: Wed, 2 Apr 2003 12:29:10 -0800
Lines: 50
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit