Copy link to clipboard
Copied
All,
Thanks in advance for any help with this. I am trying to script the creation of a swatch group and then select all spot colors in the document and add them to the group. This is what I have so far.
var doc = app.activeDocument;
var colorgroup = doc.swatchGroups.add();
colorgroup.name = 'ArtiosCad';
//var selSwatch = doc.swatches.getSelected();
//var swatch = doc.swatches;
for (a=0; a<doc.swatches.length; a++) {
var currentSwatch = doc.swatches;
var swatchColor = currentSwatch.color;
if (swatchColor == "SpotColor") {
//colorgroup.colors.push(swatchColor);
colorgroup.addSpot(swatchColor);
}
}
I am not very familiar with java script and am piecing this together from other answers found on the site. Any help would be appreciated. Thanks.
Salut !
Move spot in group...
var doc = activeDocument;
if (doc.spots.length >1) {
var colorgroup = doc.swatchGroups.add();
colorgroup.name = 'ArtiosCad';
for (i = 0; i < doc.spots.length-1; i++) {
colorgroup.addSpot(doc.spots);
}
}
Copy link to clipboard
Copied
Salut !
Move spot in group...
var doc = activeDocument;
if (doc.spots.length >1) {
var colorgroup = doc.swatchGroups.add();
colorgroup.name = 'ArtiosCad';
for (i = 0; i < doc.spots.length-1; i++) {
colorgroup.addSpot(doc.spots);
}
}
Copy link to clipboard
Copied
Thank you! I really appreciate the help with this.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now