Wednesday, May 22, 2019

#1 2019-03-15 01:39:54 am

tobiso83
Member
Registered: 2019-03-14
Posts: 2

Fill Illustrator Compound Path with Apple Script

Hello,

after just reading and learning a lot of Apple Script. I tried to make a a script to change the color of compound path items. But it looks like that it doesn't work.

I get an Error "„Adobe Illustrator“ hat einen Fehler erhalten: „every compound path item of document 1 whose filled = true“ kann nicht als „{class:spot color info, tint:100.0, spot:spot 1 of document 1}“ gesetzt werden."

Maybe there is someone who solved this problem alreadys or may help me.

Applescript:

tell application "Adobe Illustrator"
   tell document 1
       set LayerCut to "Reg"
       set SpotColor to color of swatch "Spot Color"
       set (fill color of every compound path item whose filled is true) to SpotColor
   end tell
end tell

Greeting
T.

Model: iMac
AppleScript: 2.7
Browser: Safari 537.36
Operating System: macOS 10.13

Offline

 

#2 2019-03-17 05:23:05 pm

Marc Anthony
Member
From:: Dallas, TX
Registered: 2006-04-27
Posts: 872

Re: Fill Illustrator Compound Path with Apple Script

Hi. Compound paths have no color property; their color comes from constituent path items. 

Applescript:

tell application "Adobe Illustrator"'s document 1
   set chosenSpot to spot "Spot Color"'s color
   repeat with counter from 1 to count compound path items
       set compound path item counter's path item 1's fill color to chosenSpot
   end repeat
end tell

edit: The loop and variabilization aren't technically necessary. This is simpler, although it isn't error trapped against the user cancelling without selecting a spot choice.

Applescript:

tell application "Adobe Illustrator"'s document 1 to set compound path items's path item 1's fill color to (swatch ((choose from list (get spots's name))'s item 1)'s color)

Last edited by Marc Anthony (2019-03-21 04:52:53 pm)

Offline

 

#3 2019-04-02 06:42:23 am

tobiso83
Member
Registered: 2019-03-14
Posts: 2

Re: Fill Illustrator Compound Path with Apple Script

Thank you Marc, that's it!

Last edited by tobiso83 (2019-04-02 06:42:36 am)

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)