The following script will get a list of every fill color used in an InDesign CS document.
It works if all the colors are process. But if it encounters a spot color I get a message on line 17, something like:
Can’t set end of “PANTONE 3415 C” to “Black
C=0 M=100 Y=0 K=0
C=100 M=90 Y=10 K=0”.
The answer’s probably simple, but it’s really hanging me up.
set theFillList to {}
tell application "InDesign CS"
set myDoc to document 1
tell myDoc
set everyFrame to (every text frame)
repeat with T in everyFrame
repeat with i from 1 to (count everyFrame)
set TheFrame to (item i of everyFrame)
set all_fills to (the name of fill color of every word of TheFrame) as list
set return_list to {}
repeat with a_fill in all_fills
if return_list does not contain a_fill then set end of return_list to (contents of a_fill)
end repeat
set this_fill to return_list
set {ATID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set this_fill to this_fill as string
if theFillList does not contain {(this_fill)} then set end of (theFillList) to (this_fill)
set AppleScript's text item delimiters to ATID
set theFillList to theFillList as string --this gets every fill color of page
end repeat
end repeat
end tell
end tell