Highlighted

How to edit "launch.json" file in VSC (Visual Studio Code) to automatically run current file in AI?

Adobe Community Professional ,
Aug 19, 2020

Copy link to clipboard

Copied

I am moving to VSC for ExtendScript development and have a question about the "launch.json". I read that it can be edited to target a specific application when running a script. But I can't find instructions for "How" to do that.

 

    "version": "0.2.0",
    "configurations": [

        {
            "type": "extendscript-debug",
            "request": "launch",
            "name": "Launch Program",
            "program": "${file}",
            "stopOnEntry": false
        },
    ]
}

 

The above "launch.json" will run the current file to Illustrator as long as AI has been selected from the "Target Apps" list at the bottom of VSC. Problem is this selection is lost between sessions and I ONLY develop for AI (right now). 

Note: There is no "JSON" code option in the "Format Code" feature in this forum.

Hi, use "targetSpecifier". This is what I use for a simple case of "debug the file I'm editing right now":

 

{
    "type": "extendscript-debug",
    "request": "launch",
    "name": "Debug current file",
    "program": "${file}",
    "targetSpecifier": "illustrator-24.064"
}

 

You can find the version of Illustrator by doing app.version, and taking the main version number (24 for me) and adding 0.64 for 64 bit. I haven't done this with many versions, and only on Mac,  so I don't know how robust this method is.

TOPICS
Scripting

Views

79

Likes

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

How to edit "launch.json" file in VSC (Visual Studio Code) to automatically run current file in AI?

Adobe Community Professional ,
Aug 19, 2020

Copy link to clipboard

Copied

I am moving to VSC for ExtendScript development and have a question about the "launch.json". I read that it can be edited to target a specific application when running a script. But I can't find instructions for "How" to do that.

 

    "version": "0.2.0",
    "configurations": [

        {
            "type": "extendscript-debug",
            "request": "launch",
            "name": "Launch Program",
            "program": "${file}",
            "stopOnEntry": false
        },
    ]
}

 

The above "launch.json" will run the current file to Illustrator as long as AI has been selected from the "Target Apps" list at the bottom of VSC. Problem is this selection is lost between sessions and I ONLY develop for AI (right now). 

Note: There is no "JSON" code option in the "Format Code" feature in this forum.

Hi, use "targetSpecifier". This is what I use for a simple case of "debug the file I'm editing right now":

 

{
    "type": "extendscript-debug",
    "request": "launch",
    "name": "Debug current file",
    "program": "${file}",
    "targetSpecifier": "illustrator-24.064"
}

 

You can find the version of Illustrator by doing app.version, and taking the main version number (24 for me) and adding 0.64 for 64 bit. I haven't done this with many versions, and only on Mac,  so I don't know how robust this method is.

TOPICS
Scripting

Views

80

Likes

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
Aug 19, 2020 0
Contributor ,
Aug 19, 2020

Copy link to clipboard

Copied

Hi, use "targetSpecifier". This is what I use for a simple case of "debug the file I'm editing right now":

 

{
    "type": "extendscript-debug",
    "request": "launch",
    "name": "Debug current file",
    "program": "${file}",
    "targetSpecifier": "illustrator-24.064"
}

 

You can find the version of Illustrator by doing app.version, and taking the main version number (24 for me) and adding 0.64 for 64 bit. I haven't done this with many versions, and only on Mac,  so I don't know how robust this method is.

Likes

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
Reply
Loading...
Aug 19, 2020 3
Adobe Community Professional ,
Aug 19, 2020

Copy link to clipboard

Copied

Hey, that works! Thanks for the help.

Likes

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
Reply
Loading...
Aug 19, 2020 1
m1b LATEST
Contributor ,
Aug 19, 2020

Copy link to clipboard

Copied

You're welcome!

Likes

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
Reply
Loading...
Aug 19, 2020 0
Resources