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

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

LEGEND ,
Aug 19, 2020 Aug 19, 2020

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.

TOPICS
Scripting
2.7K
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 , Aug 19, 2020 Aug 19, 2020

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

...
Translate
Adobe
Community Expert ,
Aug 19, 2020 Aug 19, 2020

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.

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

Hey, that works! Thanks 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
Community Expert ,
Aug 19, 2020 Aug 19, 2020
LATEST

You're welcome!

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