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

VSC launch.json question...

Contributor ,
Sep 20, 2023 Sep 20, 2023

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.

 

TOPICS
Scripting
769
Translate
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

Community Expert , Sep 21, 2023 Sep 21, 2023

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

Translate
Community Expert ,
Sep 20, 2023 Sep 20, 2023

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

Translate
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
Contributor ,
Sep 21, 2023 Sep 21, 2023

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.

Translate
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 Expert ,
Sep 21, 2023 Sep 21, 2023

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

Translate
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
Contributor ,
Sep 21, 2023 Sep 21, 2023

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 🙂

Translate
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
Contributor ,
Sep 21, 2023 Sep 21, 2023

Hi Manan,

Do I need to add something to the launch.json file if I want to log results as below?

$.writeln('Here!')

 

Thanks Manan.

Translate
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 Expert ,
Sep 21, 2023 Sep 21, 2023

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

 

Translate
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
Contributor ,
Sep 22, 2023 Sep 22, 2023

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 🙂

Translate
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 Expert ,
Sep 22, 2023 Sep 22, 2023
LATEST

Oh yeah I have done this so many times myself! Sorry I didn't think of it in your case.

Translate
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