Copy link to clipboard
Copied
Hi scripting community,
I've spent some time searching for what i thought might be something simple but can't find anything that works in the current version of illustrator.
I'm after a script that can search the current document for any element with the specific colour name "Cut" and move said items to an existing layer called "Diecut"
Thanks for your help!
Doing something to everything that matches conditions is one of the most AppleScript-friendly processes.
The following example moves path items whose editable and stroke color is spot "Cut" to layer "Diecut".
tell application "Adobe Illustrator"
tell document 1
set dst_layer to layer "Diecut"
tell (path items whose (editable of it is true) and (class of stroke color of it is spot color info) and (name of spot of stroke color of it is "Cut")) to move to dst_layer
end tell
end tell
Copy link to clipboard
Copied
Does it have to be Applescript (i.e. so as to exclude JavaScript)? Are some of the items nested? (If so, what is to be done in this case?) What is the color type?
Copy link to clipboard
Copied
Idealy applescript becuase i've already got some code doing other things. All the elements are of basic constriction (shapes, lines etc) The colour 'Cut' is made as a spot colour and the document format is CMYK.
Copy link to clipboard
Copied
Doing something to everything that matches conditions is one of the most AppleScript-friendly processes.
The following example moves path items whose editable and stroke color is spot "Cut" to layer "Diecut".
tell application "Adobe Illustrator"
tell document 1
set dst_layer to layer "Diecut"
tell (path items whose (editable of it is true) and (class of stroke color of it is spot color info) and (name of spot of stroke color of it is "Cut")) to move to dst_layer
end tell
end tell
Copy link to clipboard
Copied