#targetengine not working in VSC

Adobe Community Professional ,
Jun 24, 2022 Jun 24, 2022

Copy link to clipboard

Copied

Hi All, I’m having a problem with event scripts that need a target engine in Visual Studio Code with the latest ExtendScript Debugger 2.02. I get an error running out of Code but not when I run from the Scripts panel.

This:

#targetengine "session";
main();

function main(){
    app.eventListeners.add("beforeExport", onExport );
}

/**
* Function to run before an Export
* @ param the event 
*/
function onExport(e){
    alert("Hello")
}

 

Throws this error running from VSC:

 

Screen Shot 8.png

 

I have a feeling the problem might be with my JSON launch code, which is this—do I need something different for engineName?:

 

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "ExtendScript debug", 
      "type": "extendscript-debug",
      "request": "launch", //"launch" or "attach"
      "hostAppSpecifier": "indesign",
      "engineName": "main",
    }
  ]
}

 

TOPICS
Scripting

Views

60

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

correct answers 1 Correct answer

Adobe Community Professional , Jun 24, 2022 Jun 24, 2022

I should have tried before posting setting engineName to "session" seems to work.

Likes

Translate

Translate
Adobe Community Professional ,
Jun 24, 2022 Jun 24, 2022

Copy link to clipboard

Copied

I should have tried before posting setting engineName to "session" seems to work.

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
Guru ,
Jun 25, 2022 Jun 25, 2022

Copy link to clipboard

Copied

LATEST

Kris Coppieters recommends replacing ‘#’ for directives with ‘//@’:
#targetengine -> //@targetengine

 

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