🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #2606

Re: [AS] get a list of the used swatch colours in a document

#2606
From: KEVINP1
Date: Thu, 11 Dec 2008 20:27
31 lines
1838 bytes
Hi Shane thanks for pointing me in the right direction, I have come up with the below which does what I am after, how would I go about having the result returned as individual colors, not in a list but like

set {a} to color/swatch 1 of the result
set {b} to color/swatch 2 of the result

not quite sure how to go about it

----------------
tell application "Adobe InDesign CS3"
	activate
	delete unused swatches of document 1
	set _NotUSED to {"None", "Paper", "Black", "Registration", "Keyline"}
	set _UpDatedList to get (name of swatches of document 1 whose name is not in _NotUSED)
	set _myDoc to active document
	tell _myDoc
		set _Colour1 to swatch "Black"
		set _FillColour to every page item of _myDoc whose fill color is _Colour1
		set NumberOfColoredObject to count of _FillColour
		set _StrokeColour to every page item of _myDoc whose stroke color is _Colour1
		set _Stroke_Fill to _FillColour & _StrokeColour
		if (count of _Stroke_Fill) = 0 then
			set _NewList to _UpDatedList
		else if (count of _Stroke_Fill) > 0 then
			set _NewList to _UpDatedList & "Black"
		end if
	end tell
end tell

----------------

Budgie
Technical Details
Message-ID: <59b73c94.4@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossing
References: <C56684EF.4CD9D%sstanley@myriad-com.com.au>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,cda3f5d182e58a01
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: KEVINP1@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: [AS] get a list of the used swatch colours in a document
Message-ID: <59b73c94.4@webcrossing.la2eafNXanI>
Date: Thu, 11 Dec 2008 12:27:44 -0800
References: <C56684EF.4CD9D%sstanley@myriad-com.com.au>
Lines: 30
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Original-Lines: 36