Scripting , how to get swatch group names?
Hi, everyone.Hope you have a fantastic days.
In advance ,I'm still not so familiar speaking in English .
Sorry if i made some stupid mistake.
I have a question.
I'm trying coding some script to get swatch list and export to a text file .
this is for using for other project.
By googling, I could find how to get swatch names.
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);// get the app descriptor
var presetsList = desc.getList(stringIDToTypeID('presetManager'));// the presets list
var swatchDesc = presetsList.getObjectValue(1);// swatches is the second key
var nameList = swatchDesc.getList(charIDToTypeID("Nm "));// there is only one key in the swatch descriptor so get the list
var nameOfFirstSwatch = nameList.getString(0);// all the name list keys are strings data types so get the first swatch name
var nList = new Array();
for (var i=0;i<nameList.count;i++){
nList.push(nameList.getString(i)+"\n")
}
alert(nList)
But unfortunately this method couldn't get swatch "group" names.
Does any one knows how to get all swatch index?
By the way ,I'm using photoshop2022.
thanks all.
