[Pythonmac-SIG] Illustrator no_color_info problem

has hengist.podd at virgin.net
Wed Jan 23 11:05:19 CET 2008


Grzegorz Laszczyk wrote:

> I have a little problem working with Illustrator objects color.
> When I have a list with 4 elements, I can make cmyk_color_info, 3 -  
> rgb_color_info.
> I'm trying to make no_color_info, but I can't.
> It's interesting, because I tried to use example from AI CS3 apple  
> script reference, pasted into AS_Translate.
> It makes CMYK, RGB but shows error when uses no_color_inf.


The following script, translated from your AppleScript via ASTranslate  
and tidied for appearance, works with CS3 here:

ai = app('Adobe Illustrator').activate()

doc = ai.make(new=k.document, with_properties={k.color_space: k.RGB})

doc.make(new=k.rectangle, with_properties={k.position: [200, 500],  
k.height: 100, k.width: 300})
doc.layers[1].path_items[1].fill_color.set({k.blue: 0, k.class_:  
k.RGB_color_info, k.green: 0, k.red: 255})

doc.make(new=k.rectangle, with_properties={k.position: [150, 550],  
k.height: 100, k.width: 200})
doc.layers[1].path_items[1].fill_color.set({k.blue: 0, k.class_:  
k.RGB_color_info, k.green: 255, k.red: 0})
doc.path_items[1].fill_color.set({k.class_: k.no_color_info})


What was your original Python script, and what error did it give?

has
-- 
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org



More information about the Pythonmac-SIG mailing list