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
`#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.
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?
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
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?
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!
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.
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?
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?
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?
From the documentation:
VS Code keeps debugging configuration information in alaunch.json
file located in a.vscode
folder in your workspace (project root folder) or in your user settings or workspace settings.