Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for professional graphic designers and non-designers trying to do their own graphic design. It's 100% free, no registration required.

I am using cs5 layers to modify and then exporting layers as files. While saving CS5 automatically adds some number sequence at the end thereby modifying my original filename.

It see to automatically embed a number sequence prefix to the exported layers, thus rendering my own file naming convention useless. Is there a fix for this? Is there an option somewhere called 'dont auto-renumber my files' or 'use layer names as file names" that I am missing?

I DO NOT want this numbering. How to prevent this ?

share|improve this question
    
no there is no misplacement. I have done File>Scripts>Load Files into Stack. Done my changes & now I have to export all layers into separate files (File>Scripts>Export Layers to Files). This is when CS5 does this auto numbering. Hope you got it now. –  Srikar Appal Sep 26 '12 at 12:21
    
While I dislike the numbering as much as you, they do make sense in addressing layers with identical names. So for me, renaming them with a small app afterwards is part of the workflow now. –  KMSTR Sep 27 '12 at 5:49
    
There's a much more elegant way to handle duplicate layer names. Instead of this shotgun approach, they could detect when a layer has the same name as another, and append a number. So the result would be something like filename.jpg, filename1.jpg. –  posit labs Mar 28 at 17:50
add comment

2 Answers

up vote 8 down vote accepted

To add in words, Since Export Layers to Files is run by some script all I had to do was find that script, then find the function which saves the layers to files, find which part of the function does the numbering prefix & comment it out.

So here are the steps -

  1. on Mac running Lion, goto Applications > Adobe Photoshop CS5 > Presets > Scripts > Export Layers To Files.jsx (in windows it's pretty much the same directory just in "program files/Adobe"
  2. Now in this file goto line 1030 and comment it out.
  3. Also in line 1031, change fileNameBody += "_" + layerName; to fileNameBody += layerName; deleting the underscore and parenthesis.
  4. Comment out line 1049 (fileNameBody += "_" + zeroSuppress(i, 4) + "s";)

Save and close the file. This should get the job done. Below are the forum source links.

http://forums.adobe.com/message/3006825

http://forums.devshed.com/photoshop-help-88/removing-number-sequence-in-export-layers-to-files-in-cs5t-730612.html

share|improve this answer
    
Sounds more elegant. And as obvious as it may be, I'd like to mention that this is in fact changing the built-in script you should keep the old code around (both lines, unchanged -- just copy and paste the one you need to change). That way if you ever need the original functionality back you just swap out the two lines you comment out. –  Johannes Sep 29 '12 at 2:38
    
yeah, cool. I always do that as a default step. It is such a basic step that I did not even mention it. Anyway thanks for mentioning for the sake of completeness... –  Srikar Appal Sep 29 '12 at 2:41
add comment

I see your problem. I don't know of any way to adjust this within Photoshop, but you do have a couple of alternatives.

First, you can batch rename all your files using Adobe Bridge. (Tools >> Batch rename) enter image description here

As you can see, this window provides many more options for renaming your files and controlling prefixes and suffixes. The downside is, if you need the layers in a particular order right when you save, bridge won't catch that as it's just renaming files that are already saved.

Second, I've written a script as an answer for another question. (Which I just updated to accommodate your need to saves layers using their layer name). The script, while not super customizable, saves all layers as either JPEG (with quality control) or PNG and saves all layers as files using their layer names. Please let me know if you run into any issues, I've only been able to test the script on my own machine and it works perfectly fine.

share|improve this answer
    
Johannes your script is good but in my computer when i run it displayed process completed but does not give any output. –  user12186 Apr 16 '13 at 8:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.