Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

compare a path item color

$
0
0

Is there a way to compare a pathItems swatch color? For example I have a layer named "032 Red" if the pathItem on this layer does NOT have a swatch color named "032 Red" alert the user there is a problem. If everything is ok alert the user that it is all good.

 

#target illustrator
var doc = app.activeDocument;
var allLayers = doc.layers;
var allLines = doc.pathItems;
var allSwatches = doc.swatches;
var redSwatch = allSwatches['032 Red'].color;


else if (allLines[i].layer == "[Layer 032 Red]"){
  if(allLines[i].strokeColor != redSwatch){  alert("Error on layer 032 Red");  }  else{  alert("032 Red layer is good");  }  }

That is just a snippet of my code but if anyone can help with that I would appreciate it!


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>