Copy link to clipboard
Copied
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
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hey Michael, hopefully I helped these guys out too, thanks to you:
http://www.photoshopcafe.com/cafe/viewthread.php?tid=34313
and
Cheers again
Copy link to clipboard
Copied
Removing the numbers or other changes to the way that script names files is a common request. Maybe one day Adobe add some naming options to the the script's dialog.
Copy link to clipboard
Copied
Hi!
I know this thread is a couple years old, but I was hoping you could help me out. I did exactly as your instructions said, and went a step further to remove the "_" from in front of the file name. The code now reads:
var fileNameBody = fileNamePrefix;
//fileNameBody += "_" + zeroSuppress(i, 4);
//fileNameBody += "_" + layerName;
fileNameBody += "" + layerName;
However, I'm still getting half of the string of numbers in front of the file name: "_0000slayername.png"
Where is that coming from?? I'm working in CS5.
Thank you in advance!
Copy link to clipboard
Copied
Hi there,
Just thought I'd complete this as I was looking for the answer and all the comments above helped me find it.
SarahAJS was very nearly there - no need for the final "". The code works like this:
var fileNameBody = fileNamePrefix;
//fileNameBody += "_" + zeroSuppress(i, 4);
//fileNameBody += "_" + layerName;
fileNameBody += layerName;
Hope it helps someone!
Copy link to clipboard
Copied
I was getting the same problem.
Comment out line 1049 (fileNameBody += "_" + zeroSuppress(i, 4) + "s";)
That should fix your problem.
Copy link to clipboard
Copied
hello sir,
Can you please help me to save png save for web names with sequential numbers as prefix or suffix, while in batch automation process
is there any script?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Rest in Peace Michael L Hale.
You were a greate help here..jj
Copy link to clipboard
Copied
Was August 3rd the day he passed away?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Ahh thank you.. That is helpful.. Will try it asap
Thanks
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
This is something that worked for me, running Photoshop CC 2014.
189 //fileNameBody += "_" + zeroSuppress(compsIndex, 4);
190 fileNameBody += "" + compRef.name;
I commented out one line 189 and deleted the underscore between the "" in line 190.
Copy link to clipboard
Copied
For PHOTOSHOP CC 2014 - September+
I took out the whole Prefix and just replaced "FileNamePrefix;" with "layerName;". Then commented out the other two lines with // (Double slashes)
1020 var fileNameBody = layerName;
1021 //fileNameBody += "_" + zeroSuppress(i, 4);
1022 //fileNameBody += "_" + layerName;
Copy link to clipboard
Copied
GREAT! Thanks so much, I was really getting tired with removing all the prefix junk manually!
Copy link to clipboard
Copied
Sorry to bug - but can someone please send me or copy/paste the full script? I can't seem to find the script anywhere...
Copy link to clipboard
Copied
SteveDolanACE‌ That script should be included with every install of PS, and located in the Presets\Scripts folder.
Copy link to clipboard
Copied
Same problem, in Photoshop 2015 this fix doesn't work, any clues? Why to add this bothering number to layer comps?