Customising 'Export Layers to Files' Naming

New Here ,
Oct 29, 2021 Oct 29, 2021

Copy link to clipboard

Copied

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

Views

80

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

JJMack

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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?

 

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

JJMack

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

@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?

 

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Hi, Stephen. Yes to both of those! 

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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);
//////////////

 

 

Likes

Translate

Translate

Report

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