InDesign: Setting color without using swatches

Googled for hours now, but didn’t find any solution. Can anybody tell me how to assign a color to an object without using swatches? Let’s say, you want each word to have its own color. With a large text, this won’t make much sense as long as you have to use thousands of swatches.

tell application "Adobe InDesign CS3"
	tell word 1 of story 1 of document 1
		set color value of fill color to {0,100,0,0}
	end tell
end tell

It tells me, that i can’t chance “the” color. Any suggestions?

Hello. You can change (editable) fill colors like this but it will result in a document-wide change to the existing swatch, which isn’t desirable. I believe the error you are receiving is likely due to the fact that you are working on an uneditable color, such as “black” or one of the other untouchables.

I think your intended method of colorizing while bypassing swatches may be outside the InDesign model, as "color value" is a swatch's property; what you can do instead is spawn a new swatch while concurrently setting the properties of your item.

set the selection’s fill color to (make new color with properties¬
{color value:{100,100,0,0}})

Hi Marc!

Thank you for that suggestion! Unfortunately it creates a lot of swatches, when you run that script over a few hundred words. That’s what i wanted to avoid.

I wanted to find the Applescript-way of what you can do by hand & mouse: select a word, goto the color palette, choose CMYK and adjust the sliders. After that there is no new swatch, but the letters have their own color.

Well, today I sadly stumbled across a hint at the Adobe site saying that it is not possible without swatches.