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:
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!
Are you modifying Adobe script "Export Layers To Files.jsx" file naming code?
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?
I would agree that where name are built. You need the set the additional name components in there.
Great - so I'm on the right track! I just need to find out what I would need to alter the .jsx to include.
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?
Hi, Stephen. Yes to both of those!
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; // 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); //////////////