Skip to main content
Participating Frequently
February 24, 2019
解決済み

VS Code ScriptUI Question - InDesign CC

  • February 24, 2019
  • 返信数 1.
  • 3686 ビュー

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

このトピックへの返信は締め切られました。
解決に役立った回答 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

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
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?