Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

[JS][CS5] automate numbering swatches?

$
0
0

Hey,

I'm trying to make a script that will automatically number swatches based on their order in the swatch panel.

 

I found this script in another topic already

 

var myDocument = app.activeDocument;for(i = 4; i<myDocument.swatches.length; i++){     if(myDocument.swatches.item(i).getElements()[0].constructor.name==='Tint'){         continue;     }     var mySwatchName = myDocument.swatches.item(i).name;     myDocument.swatches.item(i).name = ".XX." + mySwatchName;}
var nos = myDocument.swatches.length - 4;
alert("DONE and " + nos + " swatches renamed");

 

and that will rename everything with a .XX. in front of it.  However, I need the X's to be numbers starting at .01. and increasing from there.  I can't find out how to do this in javascript, can anyone help me out?

 

Thanks in advance.


Viewing all articles
Browse latest Browse all 15932

Trending Articles



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