Skip to main content
Inspiring
October 2, 2025
Answered

Hopefully simple Visual Studio Code Setup question

  • October 2, 2025
  • 2 replies
  • 822 views

I've just starting working with VS Code. I've been using ESTK. I have both Adobe FrameMaker 2019 and Adobe FrameMaker 2022 installed, but typically, we just use FM 2022.

 

My launch.json looks like this:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "extendscript-debug",
            "request": "attach",
//            "name": "Adobe FrameMaker 2022—-main",
            "hostAppSpecifier": "framemaker-17.0",
            "engineName": "main",
        }
    ]
}

But if I click eval in Adobe, I still have to select FM 2022 from the drop-down.

Possibly related, I don't recall setting a workspace, I just put the launch.json file in a .vscode folder beneath my scripts folder. Perhaps that is the issue?

Thanks in advance!

Correct answer Marshall_Brooks

Some followup questions ...

 

My launch.json doesn't seem to load automatically. i.e. I load my script in VS Code by right-clicking and saying "Open in Code". I click Run and Debug and I'm prompted to open a folder and I open the folder that my script is already in and THEN I see the options from my Launch.json file.  Seems like an extra and unneccesary step. Is there a way to avoid this?

 

UPDATE: https://code.visualstudio.com/docs/debugtest/debugging-configuration#_global-launch-configuration - according to this, I should be able to put the info in the settings.json file and have it load, but it didn't seem to work for me. This should allow it to automatically load the launch.json configuration. It wouldn't be a good idea if I were using VS Code for ESTK and Python and C#, but for only using it with ESTK, it SHOULD be more convenient, (but it doesn't seem to work ...)

 

UPDATE2: Preferred solution seems to be to Open the scripts folder - which seems to work, but seems a bit redundant since I already have the script I want to test/run open in VSCODE. Alternative seems to be to press F5, which works, but (I think) loads the default launch.json option, but since I currently only have one ...

 

Any idea why breakpoints aren't working in code? I can set them, but they seem to be ignored.

 

I was incorrect about having to save all scripts in Code. There will be a prompt to save the script, but you can just click cancel and the script will run.

 

Q2 - Is Launch the equivalent of clicking the green triangle in ESTK? That is what I am used to and probably why I am getting confused. If I click launch, the scripts runs and I can view all the debugging options. If I click Attach, I have to click "Eval in Adobe FrameMaker 2022 (main)" before anything happens (visibly). To me, it seems like an additional mouse click for no benefit - like having to open a folder in order to have my launch.json load.


Answering most of my own questions:

 

Opening VS Code:

I have previously used ESTK and Notepad++ among other editors. VS Code seems to be somewhat between ESTK and Notepad++ as follows:

  • If I open ESTK without selecting a file, I get a blank window. If I don't have ESTK open and I click a .jsx file and select Open with ESTK, that file opens. If I had five files open in ESTK when I closed the program, that SESSION is gone. The files are saved if I saved them before closing, but ESTK only opens the files I specifically tell it to.
  • Notepad++ remembers sessions. If I have "a.jsx", "b.jsx", "c.jsx", "d.jsx" and "e.jsx" open in NP++ and close the program and I right-click "a.jsx" and select open with Notepad++, it will go to the previously open "a.jsx" and my other 4 files will still be there. If I don't have NP++ open and I right-click and open "f.jsx", it will open "f.jsx" along with the previous 5 files I left open when I last closed it.
  • VS Code seems to be missing one of the steps. If I open 5 files in VS Code and close the program and then open VS Code from the start menu - all five files are loaded and my launch.json works. If I don't have VS Code open and I right-click "a .jsx" file and select "Open with Code", that file opens, but my launch.json does not work. I have to select File>Open Folder and select my project folder and then my launch code works and the other four files open. For my usage, I added a shortcut to VS code in my scripts folder. Then it was a matter of re-training myself to open the shortcut first rather than right-clicking a file and selecting "open with code".

 

BREAKPOINTS:

  • Breakpoints DO work for me (sometimes!!!). The key issue here is you have two options: RUN or RUN AND DEBUG. Usually, I was clicking Eval in Adobe at the bottom of the screen and that runs the script without checking for breakpoints. The green triangle in run and debug (with Launch) works - or if in doubt the top menu Run>Debug should always work.

 

Personally,  I'm still not seeing when I might want to use debug instead of launch, but it might have more to do with the type of code I am developing. Launch works well for me and I'm content to leave it at that.

 

Additionally, the line numbers and the code window both have a white background by default. I was finding it difficult to know where the code window starts and whether I had extra spaces at the start of a line. I modifed my settings.json file and it helped a lot. If you want to change it, go to preferences (Ctrl-Shift-P) and search settings.json and select Edit User Settings.json and add the following lines:

    // https://stackoverflow.com/questions/41055612/how-to-change-the-gutter-background-colour-in-vs-code,
    "editor.rulers": [ 0 ],
    "workbench.colorCustomizations": {
    "editorGutter.background": "#888e9228" // your color here
    },
    "editor.renderWhitespace": "all",

You can change colors and options, but this will give you a starting point for where to look!!!

 

Finally - I found this a bit odd, but it is probably default behavior: In one of my scripts, I used "If (some condition){" <Initial caps> instead of "if (some condition){" <lowercase>. When I tried to debug from VS Code, it opened the script in ESTK and said "If is not a function." I was surprised ESTK opened, although that makes sense, and I was surprised VS Code didn't flag it as an error.

 

Thanks to all and especially @m1b for the assistance!

 

2 replies

m1b
Community Expert
Community Expert
October 8, 2025

Hi @Marshall_Brooks I don't have FrameMaker, but my first suggestion is to uncomment the line in your launch.json. For two reasons: (1) I think it might invalidate the json (depending on how strict your settings are by default), and (2) you will need two configurations for your two versions of FrameMaker, so the names will be necessary to tell them apart.

 

Something like this:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "extendscript-debug",
            "request": "attach",
            "name": "Adobe FrameMaker 2019—-main",
            "hostAppSpecifier": "framemaker-15.0",
            "engineName": "main"
        },
        {
            "type": "extendscript-debug",
            "request": "attach",
            "name": "Adobe FrameMaker 2022—-main",
            "hostAppSpecifier": "framemaker-17.0",
            "engineName": "main"
        }
    ]
}

 

You can check, after setting the above configurations that they both appear in the Debug panel in VSCode. If they are set up correctly for your running version(s) of FrameMaker, you should not have to select anything when you do the "attach" command.

 

By the way, in my keybindings.json I have these for starting and stopping the debugger. I use "a" key mnemonically for "attach to host".

 

{
    "key": "ctrl+alt+cmd+a",
    "command": "workbench.action.debug.run",
    "when": "debuggersAvailable && debugState == 'inactive'"
},    {
    "key": "ctrl+alt+cmd+a",
    "command": "workbench.action.debug.stop",
    "when": "inDebugMode"
},

 

You should only have to do this once, when starting your debugging session, but sometimes you need to clear it out and start it again. Another good command to know is "Developer: Restart Extension Host" accessible via the Command Palette in VSCode. This will "reboot" the whole debugger and connection to host.

 

I don't know anything about the "workspace.txt" file you mention later. I use a '[project name].workspace" file just so I can give the project folder a custom name. I just use a simple launch.json file.

- Mark

 

P.S. another idea would be to set up a folder with another app, eg. Illustrator or Indesign and see if you can get that working. That way we could be sure that it is specific to your FrameMaker set up only.

Inspiring
October 8, 2025

@m1b - Thank you!

I'll do some testing, but I have some questions first.
- Q1 I think part of the problem is I no longer have a launch.json file. Per the creative pro.com site, I have a workspace.txt file that looks like this:

{
	"folders": [
		{
			"path": ".."
		}
	],
	"settings": {},
	"launch": {
		"version": "0.2.0",
		"configurations": [

			{
				"type": "extendscript-debug",
				"request": "attach",
				"name": "Attach to ExtendScript Engine"
			},
			{
				"type": "extendscript-debug",
				"request": "launch",
				"name": "Launch Script in ExtendScript Engine",
				"hostAppSpecifier": "framemaker",
				"engineName": "main",
			}
		]
	}
}

But I never technically open a workspace folder. I usually have all my scripts in a "\Scripts 2025" folder and right-click on a script and select "Open in Code" to open it. If I just create a \Scripts 2025\.vscode folder and create a lauch.json there, should that work, or do I need to do anything else?

- Q2 - What is the difference between "launch" and "attach" You are saying to use "attach", but "launch" seems more like what I want to do, and "Eval in Adobe" at the bottom is what I have been using (b/c that seems to work).

- Q3 - " (depending on how strict your settings are by default)" - What controls this? I've noticed a lot of problems in my script with " ... not allowed in strict mode", but I don't have "use strict" anywhere in my script. I've been fixing them, but ...

- Q4 - "you will need two configurations for your two versions of FrameMaker, so the names will be necessary to tell them apart" Actually, I'm just worried about it working with 2022, but I don't want to keep having to tell it to use that one. I'll try both to test it out, though.

I'll try the keybindings suggestions also. Unfortunately, I don't have access to any other Adobe apps (other than Acrobat) to test with.

 

 

 

Inspiring
October 8, 2025

Lots of progress. Your Launch.json seemed to work. I have a drop-down and have to select FM2019 or FM2022 and after that it uses FM2022.

Basically, I only need it to work with FM2022 so I commented out the FM2019 lines in your launch.json code.

Somewhat answering my second question: If I have "attach" in the script, the status bar changes from blue to orange (I installed Error Lens - so that might be why). and I see Eval in Adobe FrameMaker 2022 and I have to click that to run the script. I changed that from attach to launch in the script and the script runs in FM2022, which is what I wanted.

None of the options are opening ESTK today, so I'm not sure what was causing that, but that is progress.

Inspiring
October 6, 2025

I got this working - there were a couple of things I had to change ...

Mostly, I used the info from here:

https://creativepro.com/setting-up-vscode-for-extendscript-a-practical-guide/

and

https://community.adobe.com/t5/indesign-discussions/visual-studio-code-question/td-p/13802717 

Essentially, I deleted my launch.json file and created a workspace.txt file and added the launch.json info to that file (which probably wasn't the main issue.)

I changed my hostAppSpecifier to "framemaker", not framemaker-17.

And most importantly, I run the script from the Debug and Run panel and the green triangle.

If I click "Eval In Adobe" from the bottom, I still have to specify a which FrameMaker version to use.

Not sure which step fixed it, but I deleted my launch

Inspiring
October 6, 2025

I spoke too soon. I had ESTK open also previously.

 

If I click the green triangle in VS Code from the run and debug window, ESTK opens and the script runs from there. It runs in FrameMaker, but the errors show up in ESTK.

 

If I click Eval In Adobe at the bottom, it runs in FM from VS Code, but I have to select the FrameMaker version myself from the drop-down.

Inspiring
October 6, 2025

Also - this may just be how it works, but in ESTK, I can just type in code and click run.

In VS Code, it seems like I have to save the code before I can run it, even if I just want to run a test with the code.

Is this correct and expected?