Skip to main content
Participating Frequently
February 24, 2019
Answered

VS Code ScriptUI Question - InDesign CC

  • February 24, 2019
  • 1 reply
  • 3677 views

I have created a ScriptUI window, as a palette. This doesn't seem to be displayed using the window.show() function using the VS Code Debugging ESTK plugin.
If I change to a dialog window, it will be displayed, but takes a modal form which I cannot use in this scenario as I need to have this panel float over my active document.
In ESTK it works fine.
Is this feature still being worked on?

Cheers

Roy

This topic has been closed for replies.
Correct answer sharp_idea16B8

`#targetengine "session";` does not work in Visual Studio Code Extension. The problem that is happening is, in ESTK, this statement creates a new engine with name `session` and executes your script in this engine. To do this in Visual Studio Code Extension, you need to put a configuration similar to below in `launch.json`.

```

{

   "type": "extendscript-debug",

   "request": "launch",

   "name": "Ask for script name",

   "program": "<Absolute Path to your JSX file>",

   "targetSpecifier": "indesign-14.064",

   "engineName": "session"

  }

```

The above config will execute your script in InDesign CC 2019 and engine `session`. Can you try this and let us know if you still observe the issue?

1 reply

sharp_idea16B8
Adobe Employee
Adobe Employee
February 25, 2019

Could you please attach some sample script? I am assuming you are using InDesign CC. If yes, then which version?

Participating Frequently
February 25, 2019

Hey.

Yes, I am using InDesign CC2019.

Here is a snippet that show this for me:

#targetengine "session";

var p = new Window("palette", "Sample Palette");

p.preferredSize = [200,200];

var b1 = p.add('button',undefined,"Close");

b1.onClick = function(){

    p.close();

}

p.show();

var d = new Window("dialog", "Sample Dialog");

var b2 = d.add('button',undefined,"Close");

b2.onClick = function(){

    d.close();

}

d.preferredSize = [200,200];

d.show();

The palette window will only show if I invoke a dialog window straight afterwards. Closing the dialog window also closes the palette window.

Commenting out the dialog window will result in nothing showing, and nothing writing to the console.

Any advise gratefully received!!

Cheers

Roy

sharp_idea16B8
Adobe Employee
sharp_idea16B8Correct answer
Adobe Employee
February 27, 2019

`#targetengine "session";` does not work in Visual Studio Code Extension. The problem that is happening is, in ESTK, this statement creates a new engine with name `session` and executes your script in this engine. To do this in Visual Studio Code Extension, you need to put a configuration similar to below in `launch.json`.

```

{

   "type": "extendscript-debug",

   "request": "launch",

   "name": "Ask for script name",

   "program": "<Absolute Path to your JSX file>",

   "targetSpecifier": "indesign-14.064",

   "engineName": "session"

  }

```

The above config will execute your script in InDesign CC 2019 and engine `session`. Can you try this and let us know if you still observe the issue?