Where can I find the numeric list of layerKind?
I have this function which get some layers data and then do some stuff. If you see at line 24, there is an if condition "if (lyr.type == layerType" and for example, if I want to choose shape layers I have to put the number 4 using a prompt. My question is, where does this number come from? Why 4? What is 3 or 5? Where can I find a list of what is what?
Thank you for your time!!!
function getLayersData()
{
var lyrs = [];
var layers = 1;
while (true)
{
ref = new ActionReference();
ref.putIndex(charIDToTypeID('Lyr '), layers);
try
{
var desc = executeActionGet(ref);
}
catch (err)
{
break;
}
var lyr = {};
lyr.type = desc.getInteger(stringIDToTypeID("layerKind"));
lyr.name = desc.getString(charIDToTypeID("Nm "));
lyr.id = desc.getInteger(stringIDToTypeID("layerID"));
if (lyr.type == layerType && lyr.name.match(layerName))
{
var adj = desc.getList(stringIDToTypeID("adjustment")).getObjectValue(0);
if (adj.hasKey(stringIDToTypeID("color")))
{
var curColor = new SolidColor();
curColor.rgb.red = adj.getObjectValue(stringIDToTypeID("color")).getUnitDoubleValue(stringIDToTypeID("red"));
curColor.rgb.green = adj.getObjectValue(stringIDToTypeID("color")).getUnitDoubleValue(stringIDToTypeID("grain"));
curColor.rgb.blue = adj.getObjectValue(stringIDToTypeID("color")).getUnitDoubleValue(stringIDToTypeID("blue"));
lyr.color = curColor;
if (lyr.color.rgb.hexValue == currentColor[0])
{
lyrs.push(lyr);
}
}
}
layers++;
}
return lyrs
};
