JavaScript error - Object is invalid
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.. ?)
Copy link to clipboard
Copied
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 ;
Copy link to clipboard
Copied
Unfortunately, that didn't work.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I'll test that out.. Wonder if there are meant to be other scripts in that folder even.
Thanks anyway, for the suggestions!
Copy link to clipboard
Copied
Could you post the script text so that someone could see the full script and possibly work out what's going wrong?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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

