Hi all,
I’m trying to change the fill colour of every path item on a layer but I’m only having a limited amount of success.
tell application "Adobe Illustrator"
set pageItems to every page item of layer 1 of current document
set swatchColor to color of swatch "Light Green" of current document
repeat with thisPageItem in pageItems
set pathItems to path items of thisPageItem
repeat with thisPathItem in pathItems
set fill color of thisPathItem to swatchColor
end repeat
end repeat
end tell
The above script works but on layer 1 there’s a group that contains a compound path and another group and I can’t seem to target the path items that are grouped or the compound path. The layer looks like this:
layer1
-------
------------------
------------------
------------------------------
------------------------------
------------------------------
------------------------------
------------------------------
------------------------------
the below object, that are on the same layer as above have there fill colour changed:
layer1
-------
-------
------------------
------------------
------------------
------------------
------------------
------------------
------------------
is there a way I can target every path item regardless of how nested it is? almost like saying:
set pathItems to every path item in entire contents of layer 1 of current document
Many Thanks,
Nik