Skip to main content
Participant
October 11, 2018
Question

Automating text layer import across a directory of PSDs

  • October 11, 2018
  • 1 reply
  • 665 views

Hi everyone. First time posting here and looking to get more into scripting as a way to simplify repetitive tasks.

I found a very helpful script on these forums at  How to import a list of words to separated text layers? which can import text to a single, active PSD from a single txt document, and essentially, I'm looking for a way to expand this to import text from a txt file with a predictable delimiter to an entire directory of PSDs. For example:

If the text document contains:

Page 1
Text Here

More Text Here

Page 2

Even more text here

And the PSD directory contains:

1.psd

2.psd

I would want the script to insert individual text layers in 1.psd containing "Text Here" and "More Text Here", and "Even more text here" into 2.psd, and so on. Does this sound plausible?

Thank you for any input you can provide!

This topic has been closed for replies.

1 reply

JJMack
Community Expert
Community Expert
October 12, 2018

You would need to design a process that could be batched if you want to process all the PSD Files in a folder.  Write the script then record the script in an action the you would batch.   Or the Script with your process could process all the PSD file in a folder.  The folder would need to be either hard coded in the script. Or the script could prompt or put you in a Select folder dialog to get the folder to be processed..

Your Process would need to have the logic need to know what text  should be put into the document currently active.

JJMack
RS55Author
Participant
October 12, 2018

Thank you for the reply. A batch file to run a script on every PSD in a given folder is simple enough and could probably be achieved with the following if applied to the script I pulled from the other thread like so (I'm still pretty new to coding):

FOR %%f IN (*) DO "Script.jsx" %%f


But this would insert the entire text into every PSD, rather than only the text that corresponds to the given page. Any idea where to go from here?

JJMack
Community Expert
Community Expert
October 12, 2018

You need to write the script to implement your process.  If the script you have will do what you want you could record it in an action and batch that action.   However, It sound more like you need a custom script that will populate the text you want in  particular psd files determined by the document name or something about the document current data like layer name page 1 etc.  That the logic you would need to code into your script.

JJMack