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

#targetengine not working in VSC

Community Expert ,
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

192

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

Community Expert , Jun 24, 2022 Jun 24, 2022

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

Votes

Translate

Translate
Community Expert ,
Jun 24, 2022 Jun 24, 2022

Copy link to clipboard

Copied

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

Votes

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

 

Votes

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