Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

211
Visualizações
Photoshop script - set the textColor.rgb.hexValue to be equal to a file name

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)
}

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda