Script to create a text layer

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Kukurykus, Tom, xbytor

Posts: 1
Joined: Tue Sep 24, 2019 6:35 am

Script to create a text layer

Post by raaaatata »

Hi, help me write a script to create a text layer, where text = name of the active layer

User avatar
Posts: 134
Joined: Thu Jan 01, 1970 12:00 am

Re: Script to create a text layer

Post by txuku »


Not yet awake ..........
I come across your old post

Not sure if I understood everything here is a script

Code: Select all


var doc = app.activeDocument;
var nameDoc =;
var nameLayer = nameDoc ; = nameLayer;
//alert( doc.activeLayer.kind.contents );
// if there is more than one layer, do your script
if (doc.layers.length > 1) 
   for(i=0; i < doc.layers.length; i++)
      doc.activeLayer = doc.layers[i];
      //alert(doc.activeLayer.kind ) //typename
        doc.activeLayername = nameLayer;
Good luck !