Skip to main content
Inspiring
November 9, 2024

Layers from Generative Fill with Long descriptions kill the Export Process

  • November 9, 2024
  • 5 replies
  • 423 views

I made a ton of layers with Generative fill and long scripts (maxed out the characters in the script box in some cases). These layers then get labeled with the script I put in. 

 

I went to export all 50 layers through the "Export As" option. When it got to the layers with the super long name, the system simply stopped.

 

No warning, no indicator. 

 

I finally figured out it was the layer name that was the problem. When I renamed the layer to something simple, the export worked. 

 

Now, we're talking 40-50 layers I'm trying to export. There is no "Bulk Rename Layer" option, and like I said, I was not given any warning or indication the process stopped. 

 

I would figure the Export option was renaming, because I had a few layers with the same names, and it just put a number after it. 

 

1. Need a way to bulk rename layers

2. Need an option in Export to rename or truncate the long descriptive layers

 

Photoshop 26.0.0

Windows 11 (latest updates)

Intel PC

 

Steps: 

1. simply create 2 or more layers with a long description.  (If you do only 1 to export, you do get a warning during export of a long filename)

2. Select all layers, and choose "Export As"

3. Make sure all layers are checked

4. Export and choose your folder. 

 

I only saw 20 of the 50 layers get exported (because their layer names were short enough). 

5 replies

Stephen Marsh
Community Expert
Community Expert
November 13, 2024
quote

I was using the maximum characters. 


By @geekazine

 

I have no idea what this limit is. I tried 3 "long" names, but had no issues, so your names must be longer.

 

Have you tried either of the two scripted options that I supplied yesterday?

geekazineAuthor
Inspiring
November 13, 2024

I was using the maximum characters. 

It doesn't work in the current BETA of PS in bulk, but once again, if I export only 1 of the layers, it says the filename is too long. 

 

Stephen Marsh
Community Expert
Community Expert
November 11, 2024

I wanted to use Paul's script to capture the first six words, however, it wasn't working as intended.

 

So here is a simple custom script to do the same for a single active layer:

 

#target photoshop;
app.activeDocument.activeLayer.name = app.activeDocument.activeLayer.name.replace(/(\w+ \w+ \w+ \w+ \w+ \w+)(.+)/, '$1');

 

The regex isn't pretty, as I had no success with more elegant ones. I think capturing by word count is better than character count. If this script is useful, it can be easily modified to work on all selected layers. @geekazine let me know...

Stephen Marsh
Community Expert
Community Expert
November 11, 2024

@Sameer K 

 

The script that you are likely thinking of is the "Layer Name Edit" script from Paul Riggott:

 

https://raw.githubusercontent.com/Paul-Riggott/PS-Scripts/refs/heads/master/Layer%20Name%20Edit.jsx

 

Here I have used a regular expression to capture the first 30 characters from the left/beginning of the name:

 


I don't know what the actual character limitation is as @geekazine didn't mention, 30 is just a random number for demonstration purposes.

 

NOTE: In this example, I duplicated the generative fill smart object layer and then used Layer > Smart Objects > Convert to Layers to safely work on a copy.

Sameer K
Community Manager
Community Manager
November 11, 2024

Hey, @geekazine. Welcome to the Photoshop Community. Thanks for the detailed post. I'll need more info to help you figure this out. Please share the system info from Photoshop Help > System info > Copy and paste into a text document > upload and attach here. 

 

Test if the issue with Export As exists when you use Photoshop (beta). You can get Photoshop (beta) from the Beta Apps section on the Creative Cloud Desktop App > Apps page. 

 

While we currently don't have a bulk layer renaming option, our excellent experts might suggest you try something else to fit it into your workflow.

@Stephen Marsh - I somehow remember you shared something (a script, maybe) about renaming multiple layers, but I need help finding it. 

 

Thanks!

Sameer K

(Use '@mention' to tag me when you reply)