Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

204
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda