8 Replies Latest reply: Oct 11, 2013 1:12 PM by Dwight L RSS

    Error 48 @include

    Dwight L Community Member

      I am migrating to a new pc desktop, from PSCS 3 to 6. My script is returning Error 48, File or Folder does not exist. Here is the statement:

      @include "C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Presets\Scripts\ZogArt Scripts\Functions.js"

       

      I can use same path in a command window and the DIR command finds the file. I can see it using Explorer. Any thoughts?

        • 1. Re: Error 48 @include
          Dwight L Community Member

          This was a stumper, eh? I figured out what caused the Error 48, so here it is in case someone else stumbles across it.

           

          The problem is with how the path is parsed. It contains this phrase: "Adobe Photoshop CS6 (64 Bit)", and those spaces create a problem for Photoshop's Javascript engine. Because that folder (with spaces) is created by the Photoshop installer, my programmer mind says that this is a bug.

          • 2. Re: Error 48 @include
            Chris Cox Adobe Employee

            OK, have you contacted the maker of your ZogArt scripts and told them about this?

            • 3. Re: Error 48 @include
              Dwight L Community Member

              You have a solution, Chris?

              • 4. Re: Error 48 @include
                Chris Cox Adobe Employee

                No, I don't know anything about your third party scripts.

                You need to contact the maker of those scripts.

                • 5. Re: Error 48 @include
                  Dwight L Community Member

                  Thanks for taking a whack at the old ball, Chris, but I'm not sure there's much to be said really. These are not third party scripts. I am the programmer, and I just contacted me and I agreed completely about the problem. That makes two of us now who think this is a bug. <smile>

                   

                  These scripts work in PSCS3, but there were no spaces in the folders the Adobe installer created back then. I could create a spaced path and test it in CS3, but that serves no purpose. Since the Adobe Javascript engine cannot correctly parse the path the Adobe installer created, I say there is a bug, either in the installer or in the Javascript engine. Am I wrong?

                   

                  I'll have to move my functions file to another folder whose path does not confuse the engine, and make corrections if this bug reappears in other code. This error looks like a pretty insignificant fix for a good programmer, but I'm an old man with old ways, and things are maybe not so easy as they look to my clouded eyes.

                   

                  In case I'm completely misunderstanding you, are you able to write Javascript code with an Include statement that points to a file with spaces in the path to be parsed?

                  • 6. Re: Error 48 @include
                    Chris Cox Adobe Employee

                    Without seeing the rest of the code, I'm not sure why you are unable to handle spaces in filenames.

                     

                    I'd need an example to test and see why your code might be going wrong.

                    • 7. Re: Error 48 @include
                      Dwight L Community Member

                      OK, that's simple enough. Create two text files with .js extensions in the script folder, C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Presets\Scripts\. Name one file Test.js, and the other Functions.js. In Test.js you need a single line: \\ @include C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Presets\Scripts\Functions.js. You can quote the path or not. Functions.js can be left empty. Start Photoshop, then <File>, <Scripts>, <Test>. Error 48.

                      • 8. Re: Error 48 @include
                        Dwight L Community Member

                        Chris, are you there? Have you reproduced the error? I'm not sure what to do. There was no problem with spaces in the path string until I migrated the code from CS3. I'd like to keep my code in one folder if possible.