Question
[AS] Can't Find a CMYK Value Properly
I can't get Apple Script to recognize a CMYK color on a stroke. I'm trying to write a script that will step through page items in an AI file and, if it comes across items with certain CMYK values, change the values of those items.
But I'm coming across this weirdness:
If I get properties of an item, I can see that the color of a given stroke is:
stroke color:{class:CMYK color info, cyan:0.0, Zoom:100.0, yellow:100.0, black:0.0}
However, this following script does not successfully find the very same colored stroke even though the stroke color is exactly the same as that found when I used get preoperties. What's going on here. Is it a syntax error on my part or a bug?
tell application "Adobe Illustrator"
tell current document
tell layer 1
set theList to every page item of it
repeat with x from 1 to count of items in theList
repeat with k from 1 to count of theList
if stroke color of item k of theList = { class: CMYK color info, cyan:0.0, zoom:100.0, yellow:100.0, black:0.0} then
display dialog "hey"
end if
end repeat
end tell
end tell
end tell
But I'm coming across this weirdness:
If I get properties of an item, I can see that the color of a given stroke is:
stroke color:{class:CMYK color info, cyan:0.0, Zoom:100.0, yellow:100.0, black:0.0}
However, this following script does not successfully find the very same colored stroke even though the stroke color is exactly the same as that found when I used get preoperties. What's going on here. Is it a syntax error on my part or a bug?
tell application "Adobe Illustrator"
tell current document
tell layer 1
set theList to every page item of it
repeat with x from 1 to count of items in theList
repeat with k from 1 to count of theList
if stroke color of item k of theList = { class: CMYK color info, cyan:0.0, zoom:100.0, yellow:100.0, black:0.0} then
display dialog "hey"
end if
end repeat
end tell
end tell
end tell
