Add layer contents from one PSD to another based on a spreadsheet

I have a question regarding use of Applescript, Photoshop and Excel together. So far, I’ve had no luck finding answers to my question on any site. Any help or advice is greatly appreciated.

I’m using Photoshop actions to create a single Photoshop file from 2 separate JPG images. Currently, I have to maintain a separate Photoshop action which targets a specific envelope color based on the 2 columns shown in the example below. I call out the envelope action from the main action which opens the envelop file, adds the correct color envelope and so on. I would like to be able to do all of this with the same action, using Applescript or JavaScript. I’ve heard this will work if I add the JavaScript to my action. Unfortunately, I don’t know anything about the language.

Using Applescript and Photoshop, while working in Photoshop file-A, is it possible to use Applescript to open the Photoshop envelope file, copy contents of a specific layer (based on layer name) then close the file and paste the contents into Photoshop file-A?

Photoshop file-B contains about 30 layers. Each layer contains a different color envelope. I have 100’s of files represented by PS file-A which I need to add a different color envelope to each file based on information in the Excel file like shown below.

It sounds like this shouldn’t be difficult to do, but I’m not 100% clear on the functionality you need.

You say you need to “create a single Photoshop file from 2 separate JPG images.” But then later you say you need to “open the Photoshop envelope file, copy contents of a specific layer (based on layer name) then close the file and paste the contents into Photoshop file-A?” Is this describing the same thing? Is the second “jpg” you need to combine one of the “envelopes” in the second file with 30 layers, or is combining two jpg’s the first step and then there’s a second step of putting an envelope on top of them?

I don’t know what an “envelope” is in this context. Is it just a layer from the document containing the “envelopes?”

Is the second column in your spreadsheet the name of the layer in the Photoshop document with the “envelopes?”

Are the files listed in the first column all saved in a folder with the same path?

Are all the documents already the same dimensions?

What happens once the documents are combined the way you want? It sounds like they’ll have two layers - leave them that way and save as .psd or .tiff? Flatten and save as JPG? Retain the original and save the combined document as a copy, or save over the original?

Rather than copying and pasting, I’d recommend moving layers using Photoshop’s “Copy To” the other document.

Anyway, it doesn’t sound like there’s anything involved that would be difficult to script, once it’s cleared up exactly what you want it to do.

Have you tried to get started at all? Most of the help provided here is aimed at helping wit scripts, not writing complete scripts from scratch. But if it’s simple enough, you might get lucky and someone might write it for you.

Hello t.spoon,

Thank you for you reply. I over-explained the situation and should have posted these images below to help explain. Hopefully this post will help. The file named 329.psd is one example of 100’s that I have to build but the envelope color is unique to the file as shown in 329.psd.

That clears up what you mean by “envelope,” but not a lot else.

I guess the question from your post was:

The answer is “yes.” But if the files are the same resolution, then I would recommend using “copy to” instead of copy and paste.