Help! Illustrator 10.0.3 - Get the color properties of text

:oops: Does anyone know how to get the color properties of text in Illustrator? I need to open up files and check that they’re set to a CMYK color space. Then, I need to check each bit of text to see what color it is (e.g. return a value such as Cyan:32%, magenta, 0% etc). If I find any text colored 100% black (but also containing other color percentages), then I need to automatically change it so it’s just 100% black.

As far as setting the color space of a document to CMYK goes, this looks like it should work but it doesn’t!

tell application “Adobe Illustrator 10.0.3”
activate
set color space of document 1 to CMYK
end tell

I’m a newbie to Illustrator scripting but I need to get this working. Any tips would be a real help.

Many thanks!

Scripting Illustrator can be difficult because (like Quark) you have to tell specific objects within the document what to do! So, instead of writing…

tell application “Adobe Illustrator 10”
activate
set color space of document 1 to CMYK
end tell

try this instead…

tell application “Adobe Illustrator 10”
activate
tell document 1
set color space of it to CMYK
end tell
end tell

this may or may not work, I haven’t tried it yet. A good way to explore the properties of Illustrator text objects is to use the following code.

tell application “Adobe Illustrator 10”
get every text art item of document 1
end tell

once you have references to the text art items you can call for the properties of these items like so…

get properties of text art item 1 of group item 1 of layer 1 of document 1
-or-
tell layer 1 of document 1
get properties of text art item 1
end tell

Hope all this helps!
[/b][/list]