• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

VS Code ScriptUI Question - InDesign CC

Explorer ,
Feb 24, 2019 Feb 24, 2019

Copy link to clipboard

Copied

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

Views

3.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Feb 26, 2019 Feb 26, 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.

...

Votes

Translate

Translate
Adobe Employee ,
Feb 24, 2019 Feb 24, 2019

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 25, 2019 Feb 25, 2019

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 26, 2019 Feb 26, 2019

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 27, 2019 Feb 27, 2019

Copy link to clipboard

Copied

Yeah! This did it for me in my small test, now to see it will work in the same way with my other script.

Thanks AGup!  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 15, 2019 Aug 15, 2019

Copy link to clipboard

Copied

Thanks for the earlier help, but this has come up again.

Not sure if something has changed since the last time I asked, but my config is:

{

  // Use IntelliSense to learn about possible attributes.

  // Hover to view descriptions of existing attributes.

  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387

  "version": "0.2.0",

  "configurations": [

    {

      "type": "extendscript-debug",

      "request": "launch",

      "name": "PCM",

      "program": "${workspaceFolder}/hostscript_1.4.0.jsx",

      "stopOnEntry": false,

      "targetSpecifier": "indesign-14.064",

      "engineName": "session"

    }

  ]

}

I am getting the same issues, where if I change to a dialog, my window shows, but not as a palette.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 06, 2022 Mar 06, 2022

Copy link to clipboard

Copied

And now that VS Code is no longer using launch.json files, what do we do now? Does anyone know where to alter these settings?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 10, 2022 Mar 10, 2022

Copy link to clipboard

Copied

@Ken Webster: I can't find information that VS Code no longer supports using launch.json. Where did you get that information from? Can you please provide a link with this information?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 10, 2022 Mar 10, 2022

Copy link to clipboard

Copied

LATEST
quote

And now that VS Code is no longer using launch.json files, what do we do now? Does anyone know where to alter these settings?

 
I asked around:
 
VS Code keeps debugging configuration information in a launch.json file located in a .vscode folder in your workspace (project root folder) or in your  user settings or workspace settings.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines