-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run jN menu commands via other plugins or add them to NPP context menu #28
Comments
Hello Arkadiusz, Happy scripting! |
I saw this page and possibility to create own context menu, but I don't know how can I get commands from different jN scripts and put them to this context menu. Most of them (or maybe all) are anonymous (in scope) and without refactoring code its impossible, or am I wrong? Would be nice if plugin will automaticaly collect all menu commands from all scripts and expose its somehow (via object), then it would be easy to build own context menu. |
You are right! There is no regular way to collect all jN menu items. I don't think that it is good idea. Because not all of jN scripts are designed to be useful via context menu. |
Hmm it would be easier if |
@sieukrem |
The only one way is to use the native Windows API (GetMenuItemInfo) and Notepad++ (NPPM_GETMENUHANDLE). You can get the names of menu items and their Id's. |
Any small example how do this? Looks like it's not so easy: eight04/jn-npp-emmet#5 (comment) |
All scripts has own menu (in old style) so we can't add his options to NPP context menu or run them with other plugins. I test Zen Coding without any positive results:
npp_menucommand Zen Coding|Wrap With Abbreviationd
, find this item but not invokenotepad.runMenuCommand('Zen Coding', 'Wrap with Abbreviation')
, like above, find this item but not invokecontextMenu.xml
file without successThe only solution what I found is write script for WSH (.js or .vbs) with send keys (shortcut for Zen Coding commands) and run this script with above tools. But it needs to define shortcut for any actions or other scripts (created via jN) which is inconvenient. This script can be add to Npp context menu and works.
Any advice how can I solve this in a more comfortable way?
The text was updated successfully, but these errors were encountered: