InDesign CS4 Get list of colors that will output as separation

I am attempting to get the list of colors that are used in a document. Having some difficulty figuring out if I should be trying to use “Colors”, “Swatches” or “Inks” to do this. Having mixed results.

Essentially, what I am trying to do with the script is what most job slug programs do - get the list of colors that will be output when you print separations.

Anyone have code to do this already?

Thanks.

Model: iMac Intel 10.5.8
Browser: Firefox 3.0.2
Operating System: Mac OS X (10.5)

Hi. This should do it:

tell application "InDesign CS"'s document 1 to (inks whose convert to process is false)'s name

Thanks. I did figure out that I should go with “Inks”. I didn’t have the “whose convert to process is false” part though. That’s a good tip. I like your one-liner but I want to delete unused colors first as that seems to give you false colors in the ink list.

I am getting the list and then I will be displaying it with each ink on a line (separated by a carriage return). Here’s what I ended up with:

tell application "Adobe InDesign CS4"
	tell active document
		delete unused swatches
		set theList to (name of every ink whose convert to process is false)
	end tell
end tell
set AppleScript's text item delimiters to return
set theList to theList as text
set AppleScript's text item delimiters to ""
theList

It would be nice if I could only show process CMYK colors if they are actually used on the page, but I believe when you print seps you always get those pages even if they are blank. So that seems logical that the ink list would include them as well.

Thanks again.