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.