🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17857

Re: Fill color of a row (AS)

#17857
From: Kari Puikkonen
Date: Fri, 09 May 2003 18:41
50 lines
2307 bytes
Olivier,

I hope this helps!



tell application "InDesign 2.0.2" 
	tell active document 
		set FirstRowColor to color "Black" 
		set SecondRowColor to my myFindTint(document 1, "Black", 10) 
		tell selection 
			set fill color of row 1 to FirstRowColor 
			set fill color of row 2 to SecondRowColor 
		end tell 
	end tell 
end tell

--Handler for finding/returning a given tint swatch  
on myFindTint(myDocument, myColorName, myTintValue) 
	tell application "InDesign 2.0.2" 
		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



(This handler is the ONLY way I have managed to work with the tints.)

Kari
Technical Details
Message-ID: <1de90365.10@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!logbridge.uoregon.edu!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de90365.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,ee08932ee4f528f6
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-05-09 12:08:00 PST
From: "Kari Puikkonen" <kari.puikkonen@welho.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!logbridge.uoregon.edu!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Fill color of a row (AS)
Message-ID: <1de90365.10@WebX.la2eafNXanI>
Date: Fri, 9 May 2003 11:41:29 -0700
References: <1de90365.-1@WebX.la2eafNXanI>
Lines: 49
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit