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

Illustrator: Rename Swatches

$
0
0

In Illustrator Javascript, you can use the following to rename layers:

 

var doc = app.activeDocument;

// loop through all layers

for (var i = 0; i < doc.layers.length; i++) {

 

 

//Set up variables for current and new name

          var currentName = "Unused";

          var newName = "-Unused";

 

//Set up Variable to access layer name

          var currentLayer = app.activeDocument.layers[i];

 

 

          if (currentLayer.name == currentName) {

                    currentLayer.name = newName;

 

 

          }

}

 

 

Is there anyway to rename colour swatches.

 

For example, I have 20 swatches named Yellow -(Keyword). (The keyword is different for each swatch).

I would like to replace yellow with the word colour1 while replacing the -(keyword) part in tact.

 

Is this possible? My swatches are in groups, so I am not sure if it makes it more complicated.

 

Thanks!


Viewing all articles
Browse latest Browse all 12845

Trending Articles