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

Customising 'Export Layers to Files' Naming

Community Beginner ,
Oct 29, 2021 Oct 29, 2021

Hey!

 

I'm currently in the process of trying to alter the file naming when using Export Layers to Files feature to better suit my needs. I have been able to remove the 0000 number sequences from the file naming process and wondered if I could take it further by adding more information.

 

Right now, it shows DOCUMENT NAME_LAYER NAME. Ideally, I would like the ability to include a little more information from the following example:

 

Screen Shot 2021-10-29 at 8.55.10 AM.png

 

Ultimately, the saved files would show PRODUCT NAME_LAYER NAME. Or perhaps GROUP NAME_LAYER NAME if that's at all possible.

 

I am unable to simply rename the document as the product name due to that changing with different groups.

 

Thanks in advance!

TOPICS
Actions and scripting
2.6K
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
Adobe
Community Expert ,
Oct 29, 2021 Oct 29, 2021

Are you modifying  Adobe script "Export Layers To Files.jsx" file naming code?

JJMack
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 ,
Oct 29, 2021 Oct 29, 2021

I have done, yes. I followed the linked guide, above, for removing the 0000 sequences that appeared in the file names.

 

I'm not well-versed with code though, but I'm guessing there would be a way to further modify that same file to include other information, such as group names and so on. Would that be correct?

 

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 Expert ,
Oct 29, 2021 Oct 29, 2021

I would agree that where name are built. You need the set the additional name components in there.

JJMack
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 ,
Oct 29, 2021 Oct 29, 2021

Great - so I'm on the right track! I just need to find out what I would need to alter the .jsx to include.

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 Expert ,
Oct 30, 2021 Oct 30, 2021

@Dominic Mann 

 

Will your layer panel always have the same basic structure that will be used for the file naming?

 

1. The uppermost layer/set will always be used for the Group name?

2. Regardless of the quantity of layers contained in the upper set/group, the very next layer being the bottom layer will be the name used for the Product name?

 

So essentially, there are only two sources for the required layer names, the upper group and the very bottom layer?

 

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 ,
Oct 30, 2021 Oct 30, 2021

Hi, Stephen. Yes to both of those! 

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 Expert ,
Nov 02, 2021 Nov 02, 2021
LATEST

Does the following code snippet work as expected to create the desired name? I.E. is the pop-up alert dialog showing the correct name?

 

 

//////////////
// Select front layer
app.activeDocument.activeLayer = app.activeDocument.layers[0];
// Group Name
var groupName = app.activeDocument.activeLayer.name;
// Select back layer
var backLayer = app.activeDocument.layers.length - 1;
var selectLayer = app.activeDocument.layers[backLayer];
app.activeDocument.activeLayer = selectLayer;
// Product Name
var productName = app.activeDocument.activeLayer.name;
// Combined name
var nameCombo = groupName + '_' + productName;
alert(nameCombo);
//////////////

 

 

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