4

I am new to Photoshop. I have a Photoshop template with 3 text layers.

How to create a batch job for:

  1. creating .psd files by image name (each line has a unique name in CSV file) with Photoshop ?
  2. Then I want to replace three text layers with my text in CSV
  3. Finally I want to import jpeg images (that is in a folder) in each newly created .psd file. Each .psd file and image names in JPEG should matches.

Below is the example of my CSV file:

psdfile1, Image1, textlayer1, text layer2, text layerA
psdfile2, Image2, textlayer1, text layer2, text layerB
psdfile3, Image3, textlayer1, text layer2, text layerC
psdfile4, Image4, textlayer1, text layer2, text layerD
psdfile5, Image5, textlayer1, text layer2, text layerE

How can I create such a batch job, creating .psd files by image name (each line has a unique name in CSV file) usung Photoshop?

1 Answer 1

1

ExtendScript (ie JavaScript) is your friend. I can't write the code off the top of my head, but your process is pretty straight forward.

  1. Load each line in the CSV file as a separate array of strings.
  2. Open the template doc in Photoshop.
  3. For each array (ie line in your CSV):
    1. Replace the content of each text layer in succession with the appropriate array element.
    2. Save a copy of the file under the name in that same array.
  4. Loop through the remaining arrays and repeat step 3.
  5. Close the doc without saving.

Done. Couldn't be easier. Well, you know, after you debug the code for a couple hours that is ;)

You didn't say what version you're using. Whatever it is, you'll find the official guides and reference dictionaries here.

2
  • I don't know how to do step 3 and 4. Aug 16, 2013 at 20:53
  • If you can get past #1, 4 should be cake. I don't have time to dig into the scripting dictionary right now to solve #3. Did you try digging through the docs at the link I provided? That's where I'd start. Unless you really love digging through the data browser in ExtendScript ;) Aug 16, 2013 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.