Ok, here is the thing: there are many .psd files, each file has 1 text layer inside, also, each file is named after a hex color code (example: #111111.psd). I have a code that can change font color of multiple layers in multiple files, BUT, I can only specify 1 hex color in that code.
Here is the code (not mine, found it on adobe discussions):
The thing is to set the textColor.rgb.hexValue to be equal to the filename of a .psd file (as a result I need to have the text colored with the color in the file name)
var textColor = new SolidColor();
textColor.rgb.hexValue = "57a878"
function colorTextLayer(layerCol)
{
var layerCount = layerCol.length;
for (var j = layerCount - 1; j >= 0; j--)
{
var l = layerCol[j]
if(l.typename == "LayerSet")
colorTextLayer(layerCol[j].layers)
else
{
if (l.kind == LayerKind.TEXT)
l.textItem.color = textColor;
}
}
}
var selectFolder = Folder.selectDialog( "Please select folder of PSDs");
var files = selectFolder.getFiles("*.psd");
//get an array of all PSDs in the folder
var fileList = selectFolder.getFiles("*.psd");
//iterate through file list
for (var i = 0; i < files.length; i++)
{
var doc = app.open(files[i]);
colorTextLayer(doc.layers)
doc.close(SaveOptions.SAVECHANGES)
}