You can sidestep the bug that panels don’t open properly from your plugin’s submenu (in the Plug-Ins menu) by removing the submenu. The user will have to open your panels from the Plugins panel but that’s OK because they do open properly from there. At least the user won’t see empty phantom panels and wonder what’s going on!
These lines of code in the create lifecycle hook for the plugin remove the submenu:
entrypoints.setup({
plugin: {
create() {
const pluginsMenu = app.menus.itemByName('Main').submenus.itemByName('Plug-Ins');
const thisPluginSubmenu = pluginsMenu.submenus.itemByName(this.name);
if (thisPluginSubmenu.isValid) thisPluginSubmenu.remove();
We’re referencing the Plug-ins menu in the Main menu. Then we’re referencing the submenu for our plugin by passing this.name
(this
here is the plugin info of our plugin). Then we are removing the submenu.
I am aware that if you need your plugin to work in different localised versions of InDesign/OS the code might need adapting a little – someone who knows more about this than I do might need to give the proper syntax.
I don’t think there are any unintended consequences to removing this submenu (if you take this code out again and reload your plugin, uxp/InDesign recreates the submenu), but please test and use at your own discretion. I am offering the code only as a workaround (hack) for the bug. Like everyone else, I wish Adobe would fix the bug.
Philip