Script to select same stroke color and apply a new swatch...
I am trying to write a script that will select a line based on a swatch name, apply a new swatch, set the stroke, dash and miter of the line...and then create a new layer, change then name of the layer, and then move the selected items to the newly created layer.
All I could seem to accomplish was renaming a swatch.
var swatchName = app.activeDocument.swatches;
if (swatchName.length > 0) {
for (i=0; i < swatchName.length; i++){
changeName(swatchName);
}
}
function changeName(swatchObject){
if (swatchObject.name == "PANTONE Orange 021 C"){
swatchObject.name = "021 (Orange)";
}
if (swatchObject.name == "PANTONE Red 032 C"){
swatchObject.name = "032 (Red)";
}
So the goal of what I would like it to do is look for all paths with the stroke color set to "PANTONE Orange 021 C" then have it change the swatch name to "021 (Orange)". After that apply the stroke, dash and miter. Create a new layer named "021 (Orange)". Then send all of the selected lines to that layer.
PLEASE HELP AS I HAVE 200+ files to do this task to. Using a windows machine with CS3. Trying to write in javascript.