9 Replies Latest reply on Nov 13, 2016 1:18 PM by fatpanda007

    JavaScript error - Object is invalid

    kn.bernard

      Problem (while using Indesign CS6 on Mac OS X):

      • After updating to El Capitan and installing the, now necessary, legacy Java SE 6
        • there's a JavaScript error;
        • Indesign files won't open;
        • Indesign won't "Quit" without force quitting.
      • The following error message appears:

      JavaScript Error!

       

      Error Number: 54

      Error String: Uncaught JavaScript exception:

      ReferenceError: Object is invalid

       

      Engine: ConvertURLToHyperlinks

      File: /Applications/Adobe InDesign CS6/Scripts/converturltohyperlink/startup scripts/ConvertURLtoHyperlinkMenuItemLoader.jsx

      Line: 100

      Source: Folder.current = cacheCurrent ;

       

      I assume that if I knew even the basics of JavaScript for Indesign, I'd be able to solve this, but I don't, so any information would be great, thanks.

        • 1. Re: JavaScript error - Object is invalid
          Loic.Aigon Adobe Community Professional

          Hi,

           

          Looks related to some mess in the El capitan / CS6 / java cooking. Looking at the code, the Folder.current isn't declared at the time it's used hence the error. Who ever declared it before is something I can't answer. You can probably change the line 100 with :

           

           

          var cacheCurrent = Folder.current || Folder.desktop ;

           

          Which will set the desktop as current folder if Folder.current isn't declared at the time. That should prevent further errors. However keep in min that that multiple issues were reported with CS6 apps and El Capitan mostly due to JAVA and those problems will probably grow in the future to the unavoidable term where you won't be able to use CS6 anymore.

           

          Loic

          • 2. Re: JavaScript error - Object is invalid
            kn.bernard Level 1

            Hm, that doesn't seem to have worked. Do I need to move a folder or something to the desktop as well? (I assume it's pointing to something that just isn't there.. ?)

            • 3. Re: JavaScript error - Object is invalid
              Loic.Aigon Adobe Community Professional

              Hi,

               

              No that just means "current" is not a property available at this time.

               

              Try this :

               

              var cacheCurrent = Folder.hasOwnProperty("current")?  Folder.current : Folder.desktop ;

              • 4. Re: JavaScript error - Object is invalid
                kn.bernard Level 1

                Unfortunately, that didn't work.

                • 5. Re: JavaScript error - Object is invalid
                  Loic.Aigon Adobe Community Professional

                  Sorry about that, out of clues here.

                   

                  You can remove that script from that folder if it's an issue to you but I can't mesaure the side effects.

                  • 6. Re: JavaScript error - Object is invalid
                    kn.bernard Level 1

                    I'll test that out.. Wonder if there are meant to be other scripts in that folder even.

                     

                    Thanks anyway, for the suggestions!

                    • 7. Re: JavaScript error - Object is invalid
                      Skemicle Level 3

                      Could you post the script text so that someone could see the full script and possibly work out what's going wrong?

                      • 8. Re: JavaScript error - Object is invalid
                        Laubender Adobe Community Professional & MVP

                        Hi Skemicle, did you try to read out the code from the said InDesign Startup Script that is installed with every InDesign version?

                         

                        The script's source code is available for developers only, that signed in to a special Adobe program for the InDesign SDK (Software Development Kit). For the average user of InDesign the code is saved in hexbin encoding and cannot be read out as readable code easily.

                         

                        I once looked briefly into it and saw some dependencies on other ExtendScript scripts. Maybe a global variable not declared is running nuts. Maybe other things. I cannot tell, because all my installations are working flawless in this regards.

                         

                        Regards,
                        Uwe

                        • 9. Re: JavaScript error - Object is invalid
                          fatpanda007

                          Hi Uwe,

                           

                          I understand this is an old thread, but my friend had just asked me to help with a similar problem.  Adobe InDesign is failing to load and it throws a similar error.  After chasing down the startup scripts, it seems like the "app" global variable used in many Adobe applications is not properly initialized anymore, and it blows up as soon as you access it:

                           

                               app.doScript(ConvertURLToHyperlinkMenuItemLoader.script);

                           

                          The error message reported to the user is actually the very next step in the execution, and it's very misleading.  Knowing that you have looked at some dependencies on other scripts before, would you mind sharing where I should look to find those dependencies?  The same variable blows up when Flash components are loading as well.

                           

                          Thanks,

                           

                          Calvin