This has got to the point of being seriously annoying. My main PC is off at the doctors for some surgey and I am forced to try working on my laptop.
My laptop has long had a strange bug. If I open Photoshop and run a script containing a dialog, it works fine first time. But the second time I run the exact same script, the script fails with:
ReferenceError: Window does not have a constructor
I have narrowed this down further. Even if the first script run does not have a dialog, no subsequent scripts will run successfully if they contain a window dialog (other than alert).
There is an awkward workaround. This behavious does not occur if I launch the script from Bridge.
I have tried reinstalling PS and all associated apps. Exactly the same.
And yet on my main PC when I use exactly the same installation process and source it works without problem.
Furthermore, the problem does not occur on my laptop with PS CS only CS2.
I have Googled the error message and it would seem no-one else has had this problem. Has anyone got any suggestions. I am not hopeful but I thought I would try asking.
Where it really becomes a nightmare is when I have some complex debugging to do and want to use the ESTK. The ESTK can only be used with CS2, so I have to close and restart PS with every iteration of my debugging process.
Andrew
ReferenceError: Window does not have a constructor
ReferenceError: Window does not have a constructor
Hi Andrew
I've just started getting this same thing recently on my main PC, not on my laptop. The code is identical on each machine and both have CS2, only my main machine has some beta software installed (which you also have...) while the laptop does not. I share your findings especially about the script running fine first time. Sadly I don't have a solution and was at the Googling stage. Did you make any progress?
John
I've just started getting this same thing recently on my main PC, not on my laptop. The code is identical on each machine and both have CS2, only my main machine has some beta software installed (which you also have...) while the laptop does not. I share your findings especially about the script running fine first time. Sadly I don't have a solution and was at the Googling stage. Did you make any progress?
John
ReferenceError: Window does not have a constructor
No none, and this was happening long before I did any beta testing.
Andrew
Andrew
ReferenceError: Window does not have a constructor
OK, well here it only occurred in the past few weeks and I should be find the last image updated by the script and perhaps work back to find possible changes to the system. If this helps pinpoint the error, I'll update you.
John
John
ReferenceError: Window does not have a constructor
To repeat something noted in the first post - there is a workaround. If you launch your Photoshop script from Bridge (I use my Bridge-Launch script to do this) then the problem does not occur.
Also, testing today, I found that I could launch the script multiple times from the ESTK and it worked. This is definitely new - previously the ESTK generated the same No Window Constructor error but now it seems not to.
As a matter of interest I do not have any beta testing software loaded on my laptop.
Andrew
Also, testing today, I found that I could launch the script multiple times from the ESTK and it worked. This is definitely new - previously the ESTK generated the same No Window Constructor error but now it seems not to.
As a matter of interest I do not have any beta testing software loaded on my laptop.
Andrew
ReferenceError: Window does not have a constructor
I may have made some progress. I tried clearing out the contents of the StartupScripts folder and restoring one script at a time, restarting Photoshop and testing. Any user-written scripts for Bridge caused the error message, even ones with no Window commands, neither a Window.alert nor a Show. But what worked was enclosing all the code after the target in a test for the BridgeTalk.app.Name.
So changing my Bridge scripts to test the BridgeTalk.appName appears to solve the issue. It doesn't answer why this suddenly became necessary on two machines at far ends of the world!
John
So changing my Bridge scripts to test the BridgeTalk.appName appears to solve the issue. It doesn't answer why this suddenly became necessary on two machines at far ends of the world!
John
ReferenceError: Window does not have a constructor
I just ran into this as well. Thanks to the great investigative work done here, I was able to narrow it done to a single custom script in my StartupScripts folder. However, I'm still unclear what the "fix" is that's referenced here. That is, what is meant by "So changing my Bridge scripts to test the BridgeTalk.appName appears to solve the issue."? Thanks.
ReferenceError: Window does not have a constructor
Alright, I've tried adding:
if ( BridgeTalk.appName == "bridge" )
to the offending script, but no go. Guess I'll have to do some more digging...
if ( BridgeTalk.appName == "bridge" )
to the offending script, but no go. Guess I'll have to do some more digging...
ReferenceError: Window does not have a constructor
Nevermind. Got it working. It was nice talking to myself.