Hi,
This is a follow-up to the conversation we started over on the InDesign community forum.
I’m fairly confident that where things are going wrong for you is that you are trying to edit the files of your plugin in the UXP Developer Tools Debugger. I strongly recommend that you don’t do that. You told us that you are using VS Code. Edit your files in VS Code.
I primarily use the Debugger in UXP Developer Tools for the console log which shows me both calls to the log that I have entered manually in my code and errors that are generated when I make mistakes editing my files. When I “Load and Watch” my plugin, all these log messages show up in the console log as I save my files. You told us that ‘Watch’ wasn’t working for you. Rather than trying to figure out why, I thought it might be helpful if you had the files of a very simple plugin to experiment with. Attached is a plugin I have put together. I have named it “Bare Bones”. I have tried to include the minimum code you need.
com.wherebysoftware.barebones.zip (1.8 KB)
To use it . . . Download the attachment. Unzip it. Move the folder “com.wherebysoftware.barebones” to your Documents folder (or certainly somewhere where you know there won’t be any permissions issues for VS Code or UXP Developer Tools). Launch InDesign. Launch UXP Developer Tools. Click “Add Plugin”, navigate to the folder and select the Manifest file to get it in the list. Select it in the list and click “Load & Watch”. Then click “Debug”. In the Debugger window click the tab to show the Console Log. (Don’t do anything else in the Debugger!)
What you should see in the console log is a few calls that I have put in the code of the entry points.setup function. You should see:
Bare Bones Plugin Created
Bare Bones Panel Created
Bare Bones Panel Shown
If that’s what you see, everything is working fine. If you don’t see those lines, it’s not!
The Bare Bones panel in InDesign has a single button titled “Do Something”. Click on it, and you should see ‘Doing something . . .’ in the console log.
In VS Code, open the main.js file. Make a change to the file, any change, even just adding a comment line, and “Save”. UXP Developer Tools will reload the plugin and you should see those initial three lines appear again in the console.
Type some code in the main.js file, making a deliberate mistake, for instance typing ]]] on line 57. Save again, and you should see this error appear in the console:
That’s it. Let me know if it works for you or not.
Philip