Skip to main content
Participant
July 28, 2010
Answered

Removing number sequence in 'Export layers to files" in CS5

  • July 28, 2010
  • 14 replies
  • 46844 views

Hi the script automatically embeds a number sequence prefix to the exported layers, thus rendering your own file naming convention useless. Is there a fix for this? Perhaps the JS file can be rewritten? Or an option created called 'dont auto-renumber my files' or 'use layer names as file names".

This is a similar thread, but for CS2, Im trying to get answers there too.

http://www.photoshopcafe.com/cafe/viewthread.php?tid=34313

The JS edits suggested there arent working for CS5.

Please help becuase its almost as painful renaming the final files as it is to simply "file/save as", which makes this script useless.

Cheers

This topic has been closed for replies.
Correct answer Michael_L_Hale

Comment out line 1030 by adding // to the start of the line.

//fileNameBody += "_" + zeroSuppress(i, 4);

That is the line that adds the numbers to the name.

14 replies

Participant
January 21, 2014

I wanted only the Layer name to show on the file Name to make it easy.

I took out the whole Prefix and just replaced "FileNamePrefix;" with "layerName;". Then commented out the other two lines with // (Double slashes)

var fileNameBody = layerName;

        //fileNameBody += "_" + zeroSuppress(i, 4);

        //fileNameBody += "_" + layerName;

No more renaming for me, so much nicer. Remember to name your layers and remove any spaces between words for Web work.

Enjoy

- Kismet

Participant
July 24, 2013

I am having the same issue but I am exporting to JPG. I set the quality to 12 & changed all the lines of code in the script editor & replaced the script in the adobe file. I have come to the conclusion I have no idea what i am doing: can someone please let me know what to do to get rid of the extra numbers & underscores that are not located in my original layer name? Im working with photoshop CC

Inspiring
July 24, 2013

See LCorn's post above about commenting out line 1049. That line is not commented out in your screenshot. But that should only apply to layers inside layerSets.

Participant
July 18, 2013

Hello everyone,

Anyone know why this script we're talking about replaces the layername's " " (spaces) with "-" when its exported to files ?

I was looking into the script but i can't find any part of the code to do that.. I would like to filename to come exactly as the layer is named, no changes..

anyone?

thanks in advance

Inspiring
July 18, 2013

At a guess I would say that you are saving the files in the png format as that script uses SaveForWeb to export png8 or png24 files. All other formats are saved using the normal document.saveAs method.

If so you need to check your output settings under the fly-out menu in the saveForWeb dialog. Look under Saving Files and make sure Unix is not checked in the Filename Compatibility section. That is not something the script can control. With Unix checked SFW replaces spaces with the - char.

Participant
July 18, 2013

Ahh thank you.. That is helpful.. Will try it asap

Thanks

Michael_L_HaleCorrect answer
Inspiring
July 28, 2010

Comment out line 1030 by adding // to the start of the line.

//fileNameBody += "_" + zeroSuppress(i, 4);

That is the line that adds the numbers to the name.

Participant
July 28, 2010

Wow, great stuff. Thanks so much - this worked! Thanks Michael I {heart} you.

Also I was meant to tag this as 'correct answer', rather than just 'helpful'

Thanks again

Participant
July 28, 2010