Copy link to clipboard
Copied
Hi Everyone,
Please can someone point me in the right direction.
I'm currently doing some script work for InDesign.
I have placed the launch.json in the same folder as the jsx file and it looks like this...
{
// 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": "attach",
"name": "Attach Indesign",
"hostAppSpecifier": "indesign-18.064",
"engineName": "main",
"hiddenTypes": [
"builtin",
],
},
{
"type": "extendscript-debug",
"request": "launch",
"name": "Attach Indesign",
"hostAppSpecifier": "indesign-18.064",
"engineName": "main",
"hiddenTypes": [
"builtin",
],
}
]
}
When come to execute the script VSC still asks for launch or attach.
I'm then asked to select the Host Application and after that the Extendscript Engine.
Is my launch.json set up incorrect?
Thanks.
Probably the issue is with the location of your launch.json file. It is supposed to be present in the .vscode folder next to the jsx file.
Check the "Launch configurations" section in the following article for more details
https://code.visualstudio.com/docs/editor/debugging
-Manan
Copy link to clipboard
Copied
Hi @deckarduk, your launch.json seems fine. Here's mine:
{
"version": "0.2.0",
"configurations": [
{
"type": "extendscript-debug",
"request": "attach",
"name": "Start debugger—IND",
"hostAppSpecifier": "indesign",
"engineName": "main",
},
]
}
I never use "launch" so it just has the one configuration. Using the hiddenTypes: builtin is a good idea, so that shouldn't be a problem.
Do you have multiple installations of Indesign 18 installed? That will cause the behaviour you see.
- Mark
Copy link to clipboard
Copied
Hi @m1b, thanks for the help with my query.
I'm 99% sure I don't have multiple installations of InDesign 18 (2023) installed.
I'll try the launch.json code you have and see if that sorts it.
Thanks once again Mark.
Copy link to clipboard
Copied
Probably the issue is with the location of your launch.json file. It is supposed to be present in the .vscode folder next to the jsx file.
Check the "Launch configurations" section in the following article for more details
https://code.visualstudio.com/docs/editor/debugging
-Manan
Copy link to clipboard
Copied
Hi Manan,
Thank you for the help, that's sorted it.
I've found clicking on the cog, at the top of the 'RUN AND DEBUG' tab, takes me to the correct location of the launch.json file.
Thanks again for the help 🙂
Copy link to clipboard
Copied
Hi Manan,
Do I need to add something to the launch.json file if I want to log results as below?
Thanks Manan.
Copy link to clipboard
Copied
Do I need to add something to the launch.json file if I want to log results as below?
$.writeln('Here!')
Hi @deckarduk, No you don't. You should see "Here!" written in the debug console. Choose View > Debug Console menu or cmd/ctl-shift-Y.
- Mark
Copy link to clipboard
Copied
Hi @m1b, thanks for the help.
I had the Debug Console window open but couldn't see the output.
Having looked again I've spotted there was a term filtering it hence why I couldn't see the output.
Thanks again Mark 🙂
Copy link to clipboard
Copied
Oh yeah I have done this so many times myself! Sorry I didn't think of it in your case.