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

$.writeln output to VS Code Editor -- how?

Explorer ,
Apr 11, 2019 Apr 11, 2019

Copy link to clipboard

Copied

Is there someway to have a script's $.writeln output show up in VS Code instead of the ESTK?

Thanks

Views

5.0K

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 Employee , Apr 12, 2019 Apr 12, 2019

I suspect the problem is with targetSpecifier. Can you try following:

1. Remove targetSpecifier and engineName from launch.json

2. Select Indesign target and engine from `Select the target application` at the status bar in the bottom.

After selecting the target and starting the script, in the Output window, what is the value of `targetSpecifier`?

Votes

Translate

Translate
Community Expert ,
Apr 11, 2019 Apr 11, 2019

Copy link to clipboard

Copied

Hi akiva_atwood ,

from a similar question on InDesign Scripting Forum I know that you are on Mac OS X.

What's your version of VS Code Editor?

If you are executing a $.writeln() what exactly will happen?
Does the ESTK try to launch? Thought, the ESTK cannot run side-by-side with VS Code Editor.

Could you avoid using $.writeln() and switch to a different messaging system?

Write e.g. the result of the argument with toString() to a log file and execute the log after ExtendScript script run.

Regards,
Uwe

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
Adobe Employee ,
Apr 11, 2019 Apr 11, 2019

Copy link to clipboard

Copied

Can you share what you're seeing when you try to use $.writeln? Does ESTK launch, or do you just see nothing in the output of VSCode?

Also -- there is an issue where the last write may not show up in the output -- so make sure you're executing more than one $.writeln.

Finally -- try the 1.0.1 release of the plugin (release is in progress; should be on the marketplace in a few minutes) and see if anything improves.

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
Explorer ,
Apr 11, 2019 Apr 11, 2019

Copy link to clipboard

Copied

Haven't been able to get it working. (OSx, VSC 1.33.1, 1.0.1 plugin)

Uninstalled and reinstalled the plugin

1) The setup instructions don't work -- when I click the plugin gear I get

{

   // Use IntelliSense to learn about possible attributes.

   // Hover to view descriptions of existing attributes.

   // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387

   "version": "0.2.0",

   "configurations": [

 

  {

   "type": "node",

   "request": "launch",

   "name": "Launch Program",

   "program": "${file}"

  }

  ]

}

Which is not what the instructions say should be there.

I replace that with the contents from the install instruction == try to run -- and get

Can’t start a session without an active target and engine. Select an active target and engine before trying again.

I add

"targetSpecifier": "inDesign-14.0-ME",

   "engineName":"main",

and it starts ID

And gives an error: TypeError: Cannot read property 'label' of undefined

I've been running scripts from inside ID and getting the $.writeln output in the ESTK for now -- but want to get it working.

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
Adobe Employee ,
Apr 11, 2019 Apr 11, 2019

Copy link to clipboard

Copied

May be there is some syntax error in your script. Can you try with a sample script(`alert("Hello World");`) first and see if that works? Also in the configuration, ` "program": "${file}"` means that your currently focussed script(.js/.jsx) in the editor window will be executed.

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
Explorer ,
Apr 11, 2019 Apr 11, 2019

Copy link to clipboard

Copied

just tried that ('alert("hi");')

still get TypeError: Cannot read property 'label' of undefined

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
Adobe Employee ,
Apr 11, 2019 Apr 11, 2019

Copy link to clipboard

Copied

Can you attach screenshot of whole VSCode window with this error?

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
Explorer ,
Apr 11, 2019 Apr 11, 2019

Copy link to clipboard

Copied

Screen Shot 2019-04-12 at 9.38.18.pngScreen Shot 2019-04-12 at 9.39.45.png

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
Adobe Employee ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

I suspect the problem is with targetSpecifier. Can you try following:

1. Remove targetSpecifier and engineName from launch.json

2. Select Indesign target and engine from `Select the target application` at the status bar in the bottom.

After selecting the target and starting the script, in the Output window, what is the value of `targetSpecifier`?

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
Explorer ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

worked -- including $.writeln

Thanks

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 ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

Don't forget to mark 8. as correct.

AGup​ you should get a staff badge maybe TriciaLawrence​ can arrange that for you?

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
Explorer ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

I would -- but there's no correct option...

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 ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

Yes you're correct, there must be some bug with Jives now.

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
LEGEND ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

there is nothing wrong... someone changed the thread to a post instead of a question but I have set it back

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 ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

LATEST

The thread was marked as a discussion and not a question, that's why it didn't have an option to mark as correct.

I changed it to a question and marked the answer as correct.

Magic powers.

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