Macro Menu commands and the Context Menu
-
I’m using the NPP Exec plugin, and I’ve created some scripts that I’ve had it add to the Notepad++ Macro menu. I want to execute those scripts via the context menu; however, I cannot get them to appear on the menu.
I’ve checked to make sure the names are correct (including case), and I’m not sure what else to try. Here is a look at the Macro Menu overlaying contextMenu.xml showing three of the failing entries:
I am beginning to think that what I’m trying to do simply isn’t supported, even though the user manual says (emphasis mine):
“All menu commands can be added to the Context Menu, including plugin commands”.
So, my question is, can the NPP exec commands added to the Notepad++ Macro menu be executed from the context menu? Thanks to anyone who provides a definite answer.
Debug info:
Notepad++ v8.6.4 (32-bit)
Build time : Feb 20 2024 - 00:11:10
Path : E:\etc\npp864-32\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 11 Enterprise (64-bit)
OS Version : 23H2
OS Build : 22631.3155
Current ANSI codepage : 1252
Plugins :
DSpellCheck (1.5)
NppConverter (4.6)
NppExec (0.8.4)
NppExport (0.4)
nppplugin_ofis2 (3.0.1)
nppplugin_solutionhub (3.0.1)
nppplugin_solutionhub_ui (3.0.1)
nppplugin_svn (3.0.1)
NppTextFX (1.4.1)
SessionMgr (1.4.4)
tagsjump ()
TagsView (1.0.3)
WindowManager (1.2.2)
_CustomizeToolbar (5.3) -
@Jim-Dailey said in Macro Menu commands and the Context Menu:
“All menu commands can be added to the Context Menu, including plugin commands”.
I’d suggest an addendum to that make it say “All first-level plugin menu commands can be…”. If a plugin has submenus, items on the submenu cannot be added to the context menu.
can the NPP exec commands added to the Notepad++ Macro menu be executed from the context menu?
I’ve never tried that, but I know if you leave it on the NppExec menu instead of moving it to the Macro menu, you definitely can make a right-click context menu item out of it, with the simple:
<Item PluginEntryName = "NppExec" PluginCommandItemName = "foo" />
-
“All menu commands can be added to the Context Menu, including plugin commands”.
That was the general introduction sentence, which doesn’t have all the details and caveats.
I’d suggest an addendum to that make it say “All first-level plugin menu commands can be…”. If a plugin has submenus, items on the submenu cannot be added to the context menu.
In the three bullets below that, which contain the details for each of the three Context Menu syntaxes, it explicitly explains that builtin menus can be referenced to any depth, but that plugins only allow top-level.
I’m not going to reiterate that in the intro paragraph.update: I guess I could say something like “All built-in menu commands can be added to the Context Menu, as well as first-level plugin commands.” I still find the redundancy annoying, but I might be convinced to do that much.
can the NPP exec commands added to the Notepad++ Macro menu be executed from the context menu?
Notepad++ still associates those commands with the NppExec plugin, even though they are displayed in the Macros menu. So whether the NppExec commands are left in the NppExec menu or whether they are moved to the Macros menu, they can be referenced using the syntax that @Alan-Kilborn supplied:
<Item PluginEntryName = "NppExec" PluginCommandItemName = "foo" />
I have about a dozen NppExec scripts in my Macros menu that I reference in my Context Menu that way.
-
@Alan-Kilborn said in Macro Menu commands and the Context Menu:
<Item PluginEntryName = “NppExec” PluginCommandItemName = “foo” />
@Jim-Dailey That (above). I do this all the time. My NppExec scripts are added to the Macro menu and you need to use that syntax to reference them, not
MenuEntryName="Macro"
- that won’t work.Cheers.
-
Thanks, all.
I mistakenly thought I had to put the NPP Exec commands on the Macro menu to get to them via the Context Menu.
I see now that they show on the NPP Exec Menu if I don’t tell it to put them on the Macro Menu. And, as you have pointed out, even if they are on the Macro Menu, the context menu doesn’t “see” them there, but rather on the NPP Exec Menu.
Who says learning is not fun?!
-
I think the user manual is fine.
If the user reads the user manual, and copies some of its text here, we can’t know if that is all they read of it… -
@Jim-Dailey said in Macro Menu commands and the Context Menu:
And, as you have pointed out, even if they are on the Macro Menu, the context menu doesn’t “see” them there, but rather on the NPP Exec Menu.
It’s a bit odd, because when they are configured to be on the Macro menu, they don’t appear on the NppExec plugin menu, so I’m not sure how they’re actually found. Curious.