Skip to main content
K.Daube
Community Expert
Community Expert
February 18, 2017
Question

Unable to create Window

  • February 18, 2017
  • 1 reply
  • 1357 views

Dear friends and experts,
Until now I always had at least one document open before I started my script. Now I first started the script (File > Scripts > Catalog > scriptname > Run) just after FM start. The effect described also happened in the past during debugging and I attributed it to forgetting to unregister etc. But now I just 'work' with the script.
The following happens randomly after having open one or more documents.
As soon as I want to open a panel (via shortcut or from the menu) the script reports

Error Message      : Unable to create Window
Script, Line#   : E:\_DDDprojects\FM-calc\FMcalc\FMcalc_dialogC.jsx,  14


The referenced script line is this or similar:

  wPalC  = new Window("palette", goTxt.wPalC, undefined);


Each test is a separate start of FM, then starting the script, then opening the first document.
Test 1:  One document open; error after first invocation of panel
Test 2:  5 documents open; after each open invocation of panel OK
Test 3:  One document open; error after first invocation of panel
Test 4:  One document open; error after first invocation of panel
Test 5:  Open FM and just leave it. This requires at the next start to search for the script.
Test 6:  4 documents open; after each open invocation of panel OK

What I have found so far on this problem is of little help: www.hivmr.com, www.deskdr.com

The only reasonable information is given here: simplephotoshop.com/elementsplus/
«Unfortunately, this is a bug in Adobe's script engine known to users of PSE and Photoshop and the total remedy hasn't been found yet. As a rule, this problem resolves itself after several computer re-boots. However, if in your case the problem persists, the author can suggest the only solution - using the action based version of "Elements+" »

This reflects my experience of randomness.
Any other ideas how to cure the problem?

This topic has been closed for replies.

1 reply

K.Daube
Community Expert
K.DaubeCommunity ExpertAuthor
Community Expert
February 26, 2017

Since no sulution can be seen on the horizon, i decided to at least inform the user more friendly about the situation. Because the error is just written in the log file, the user may not get a glimpse what happened - the script just does not react any more.

Hence I put Try / Catch around the statements defining the panel windows - and hope that the user can go with it:

try { wPalC  = new Window("palette", goTxt.wPalC, undefined); }
catch (e) {
  alert ("Very sorry to tell you that ExtendScript is not willing to create the panel\nThe only cure is to restart FM (even better: twice) and run the script again");
  return;
}

Klaus Göbel
Legend
February 27, 2017

Hi Klaus,

if you could send me your script, I could test it for you. I have a guess....but I have to do some tests.

K.Daube
Community Expert
K.DaubeCommunity ExpertAuthor
Community Expert
February 28, 2017

Many thanks Klaus, for this offer.

I will sen the script (+ testfiles) offline to you.