script to import a list or words into photoshop layers
In the old forum there was a very useful script to import words from a text file into individual layers in Photoshop. These old posts are gone unfortunately and due to a hard drive failure and lack of proper backup, I have lost the script. It was in forums.adobe.com/thread/2200206 and here is a portion of the post I found in a cache. Does anyone have the complete script?
Here's a quick script that can do. It assumes that there is a text file on your desktop named "name list.txt" it also assumes that the text using a return between names file, this can be changed to commas or anything else you want to use. You must also have an open file to make it work. It does not define the font or the font size, but you can put in the script or select all layers later and change it at once.
#target photoshop
var doc = activeDocument
var textFile = new File(Folder.desktop+ '/name list.txt');
var list = readText (textFile).split('\n');
for (var i = 0;i<list.length;i++){ var="" artlayerref="doc.artLayers.add()" artlayerref.kind="LayerKind.TEXT;" textitemref="artLayerRef.textItem;" textitemref.contents="list[i]" }="" function="" readtext(file){="" if="" (textfile.exists)="" {="" textfile.encoding="UTF8" ;="" textfile.linefeed="unix" textfile.open("r",="" "text",="" "????");="" str="textFile.read();" textfile.close();="" return="" str;="" <="" pre=""> </list.length;i++){>
