6 Replies Latest reply on Oct 7, 2011 2:35 PM by Matt McFaul

    Layers to Comps: The script is cutting off my file name

    Lood.io

      My layer comps have mosty long names, so I can identify them.

      The problem occurs when exporting the layer comps to files: It cutts my file names like this:

       

      LCH_16_Entry_Screen_Location_#0

       

      So, the file extension ".png" is missing.

      And instead of the missing part, the script adds that hash symbol and a zero "#0".

      Because of this I am spending every day about 20 minutes by fixing the file names.

       

      20min x 5 days x 40 weeks x 4 years since I am using this script= 16000 minutes =266 hours x 140.-/h. = 37'000 Swiss francs lost

       

      Sorry Adobe, but the companies I work(ed) for have spent kind of 10'000$ in the past decade for buying your products in order to have an intuitive UI and not for searching bug fixes in some java scripts...

       

      Anybody who can help me fix this??? :-((((

       

      Thanx

      Davo

        • 1. Re: Layers to Comps: The script is cutting off my file name
          c.pfaffenbichler Level 9
          Sorry Adobe, but the companies I work(ed) for have spent kind of 10'000$ in the past decade for buying your products in order to have an intuitive UI and not for searching bug fixes in some java scripts...

          This is a user to user-forum (though luckily with Adobe employees dropping by occasionally), so you will hardly get an official reaction here.

          If the product does not live up to your expectations you might want to look into how you arrived at those – did Adobe make promises it did not keep or were you just assuming stuff Adobe did not declare to be the case in any way?

           

          Anyway, if you mean »Layer Comps To Files.jsx«:

           

          Is »LCH_16_Entry_Screen_Location_#0« and actual example?

          What is the Layer Comps actual name in this case?

           

          Because at a cursory glance line 193 might be responsible for cutting names, but your example is much shorter than 120 letters.

                          if (fileNameBody.length > 120) fileNameBody = fileNameBody.substring(0,120);

          • 2. Re: Layers to Comps: The script is cutting off my file name
            Michael L Hale Level 5

            I'm not sure the shortened filename is a bug. That script uses sfw to save png files. My guess is that you have Mac OS 9 checked under your save for web output settings. It is the output setting that trims the filename.

             

            However if you want to 'fix' the script comment out the lines between case png24Index: and break and add the following before break

             

                           pngSaveOptions = new PNGSaveOptions();
                           pngSaveOptions.interlaced = dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Inter.value;
                           app.activeDocument.saveAs( new File( exportInfo.destination + "/" + fileNameBody + ".png") , pngSaveOptions, true, Extension.LOWERCASE );
            

            That will do a normal save for png24 and it will not matter what how your sfw settings are set.

             

            Note that because the name can also include the comp's comments the total name length is trimmed to 120 chars elsewhere in the scipt.  Look for the line

             

            if (fileNameBody.length > 120) fileNameBody = fileNameBody.substring(0,120);

             

            if the names are still being trimmed.

            • 3. Re: Layers to Comps: The script is cutting off my file name
              Lood.io Level 1

              Thanks guys for your replays.

               

              Sad but true: I can't find the options under "save for web & devices" in my PS CS4 extended, where I could change from mac os9 to something else.

              Could you please tell me, where this is? Thanks in advance!

               

              Davor

              • 4. Re: Layers to Comps: The script is cutting off my file name
                Michael L Hale Level 5

                In the upper right of the sfw dialog there is a little icon of a triangle and 4 black lines. If you click on that icon a popup menu will appear. Select the last item in that menu. For Engilsh systems it says 'Edit Output Settings...'. Another dialog will popup and it will have two dropdown boxes near the top. In the second one choose 'Saving Files'. Do so will change the contents of the dialog so that you should now see three checkboxes under 'Filename Compatibility'. Uncheck 'Mac OS 9' and 'OK' out of that dialog.

                • 5. Re: Layers to Comps: The script is cutting off my file name
                  Lood.io Level 1

                  I have tried that out, but it didn't help. And also the option with changing the script in the line 193 haven't brought a solution. It is always cutting off the file names and the file extension, which makes the files not usable for many purposes...

                   

                   

                  • 6. Re: Layers to Comps: The script is cutting off my file name
                    Matt McFaul Level 1

                    I had a go at amending that script and it seems to work - I posted the script and description here:
                    http://mousematt.posterous.com/layer-comps-to-files-without-the-numbered-pre