🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #19283

Re: Pantone tint

#19283
From: Olav Kvern
Date: Thu, 02 Jan 2003 21:16
45 lines
2204 bytes
Kari--

Here's a general-purpose tint-finding handler that behaves a bit better. I have never had much luck getting multiple case filter ("whose") clauses to work.



tell application "InDesign 2.0.1" 
	--Example of calling the tint-finding handler. 
	set myTint to my myFindTint(document 1, "PANTONE 1805 U", 50) 
end tell

--Handler for finding/returning a given tint swatch 
on myFindTint(myDocument, myColorName, myTintValue) 
	tell application "InDesign 2.0.1" 
		tell myDocument 
			try 
				--Find all of the tints of a given base color. 
				set myTints to tints whose name is myColorName 
				--Iterate through the tints looking for a specific tint value. 
				repeat with myTint in myTints 
					if tint value of myTint is myTintValue then 
						--If the Tint value matches, then we've found our tint swatch. 
						--Use "object reference of" to get a direct reference to the tint object. 
						return object reference of myTint 
						exit repeat 
					end if 
				end repeat 
				--If we made it to this point, we haven't found the tint, so throw an error. 
				error 
			on error 
				--No existing tint with the tint value we're looking for exists, so make one. 
				set myTint to make tint with data {color:color myColorName} 
				set tint value of myTint to myTintValue 
				return myTint 
			end try 
		end tell 
	end tell 
end myFindTint 




Thanks,

Ole
Technical Details
Message-ID: <1de72e91.7@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!gestalt.direcpc.com!news.stealth.net!news.stealth.net!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de72e91.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,e4d80716eba899ff
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-01-02 13:37:51 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-01!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!gestalt.direcpc.com!news.stealth.net!news.stealth.net!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Pantone tint
Message-ID: <1de72e91.7@WebX.la2eafNXanI>
Date: Thu, 2 Jan 2003 13:16:10 -0800
References: <1de72e91.-1@WebX.la2eafNXanI>
Lines: 46
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit