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

How to run illustrator script from VS Code (Visual Studio Code)

New Here ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

A Google search will bring up many extensions with half-baked instructions on how to use them.

 

What is the definitive extension for running illustrator scripts in VS Code?

 

And where can I get full instructions on setting up and using it?

TOPICS
How to , Scripting

Views

220

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
community guidelines
Community Expert ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

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
community guidelines
Community Expert ,
Nov 20, 2022 Nov 20, 2022

Copy link to clipboard

Copied

Hi @default30a91r3twkdw, once you have read the instructions on the ExtendScript Debugger install page that @Charu Rajput linked to, see if it helps to have a look at my own set-up. (I'm using MacOS; if you are using Windows, change the keybindings accordingly.)

 

This is my launch.json for Illustrator scripting:

{
    "type": "extendscript-debug",
    "request": "attach",
    "name": "Start debugger—AI",
    "hostAppSpecifier": "illustrator",
    "engineName": "main",
}

It uses the "attach" request, which means you start the debugger once, and then when you run your scripts from VSCode it uses the same debugger instance.

 

I also have these in my user settings.json file, just to tailor my IDE the way I prefer:

"debug.console.closeOnEnd": true,
"debug.internalConsoleOptions": "neverOpen",
"debug.openDebug": "neverOpen",
"debug.toolBarLocation": "docked",

 

And last, but not least, I have these in my keybindings.json file:

{
    "key": "f5",
    "command": "-workbench.action.debug.start",
    "when": "debuggersAvailable && debugState == 'inactive'"
},
{
    "key": "cmd+r",
    "command": "extension.extendscript-debug.evalInAttachedHost",
    "args": {
        "debugLevel": 1,
        "bringToFront": false
    }
},
{
    "key": "cmd+shift+r",
    "command": "extension.extendscript-debug.evalInAttachedHost",
    "args": {
        "debugLevel": 1,
        "bringToFront": true
    }
},
{
    "key": "cmd+.",
    "command": "extension.extendscript-debug.haltInHost",
    "when": "inDebugMode",
},
{
    "key": "ctrl+.",
    "command": "workbench.action.debug.stop",
    "when": "inDebugMode"
},

I use cmd+r to run a script without activating the host app (eg. if I just want to watch the console or debugger), and cmd+shift+r if I want to activate the host app (note that your scripts may activate the host app anyway if they show a dialog etc).

 

Well that's my set-up. I hope it gives you some idea of how to customize it to your preferences.

- Mark

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
community guidelines
Adobe Employee ,
Nov 21, 2022 Nov 21, 2022

Copy link to clipboard

Copied

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
community guidelines
Community Expert ,
Nov 21, 2022 Nov 21, 2022

Copy link to clipboard

Copied

LATEST

Thanks @erinferinferinf that is helpful. I didn't know about the "excludes" property of the launch configuration.

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
community guidelines