Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Automating the filename prefix in Layer Comps to files...

Community Beginner ,
Mar 17, 2011 Mar 17, 2011

Hi All

I'm hoping someone can help me with some automation. I have no real clue about scripting, I just know that clever things can be done, hopefully someone could point me in the right direction!

I'm superimposing some t-shirt designs onto images of blank t-shirts.

Each different colour T-shirt (15 colours) is on an individual layer, so I have 15 layers.

So to create 15 images of a given t-shirt design (one image for each colour shirt) I need to:

1) Import a design onto the top layer

2) Update all 15 layer comps

3) Hit the 'Layer Comps to Files' button

4) Put a unique identifier into the filename prefix field

5) Go to 1)

So I guess my question is this:

Can I automate any more of this? For example can I have the filename prefix pulled in from the Layer name? So I'd just name the top layer (with the design on) and PS would pull that layer name into the filename prefix field?

And can I update all those layer comps automatically (when I put the next design on) rather than selecting each one and updating manually?

Any help appreciated from a scripting novice!

Kind Regards

Mark

TOPICS
Actions and scripting
2.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Mar 17, 2011 Mar 17, 2011

If you turn the top layer with the design into a smart layer then manually update the layer comps once and save the file as a template you can then use the menu item Layer-Smart Object-Replace Cotents... to change out the design in a way that would no longer require updating the layer comps. Changing the content of a smart object does not effect the layer comp status like adding a new layer would.

In the Layer Comps to Files.jsx if you find the line

var fileNameBody = exportInfo.fileNamePrefix;

and

...
Translate
Adobe
Mentor ,
Mar 17, 2011 Mar 17, 2011

If you turn the top layer with the design into a smart layer then manually update the layer comps once and save the file as a template you can then use the menu item Layer-Smart Object-Replace Cotents... to change out the design in a way that would no longer require updating the layer comps. Changing the content of a smart object does not effect the layer comp status like adding a new layer would.

In the Layer Comps to Files.jsx if you find the line

var fileNameBody = exportInfo.fileNamePrefix;

and replace it with

var fileNameBody = app.activeDocument.layers[0].name;// top layer name

The script will no longer use the prefix from the dialog and instead use the top layer's name as the prefix.

To automate the whole process would require creating a custom script. The Layer Comps to Files script was not written to be called from another script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 21, 2011 Mar 21, 2011

Hey Michael

THats great, thank you very much for your help.

I may look at the fully automated script - please can you let me know your email address if you could write such a script?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 25, 2015 Apr 25, 2015
LATEST

Hey I came across this with a similar question. How can I make it the document name instead of the top layer name? I know this is old news, but I'd appreciate it!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines