A lot of editors have script languages
And so does Notepad++.
The one I am most familiar with is Pythonscript (it’s a plugin), but there are others.
we could define a single API function to access them
NotepadCommand(“Npp_InsertText”, “Npp_CursorPosition”, “Text to be inserted” );
So Pythonscript uses some objects to define an API, examples:
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4028 << built-in would be perfect, but … right now you have to deal with plugins.
Ekopalypse last edited by
@Alan-Kilborn I did not know of Phytonscript. It is not part of the basic package, isn’t it? Any other script language can be used with Notepad++? Where can I fond docs?
@Ekopalypse Great! Thank you.
@Ekopalypse I installed JN and I got a lot of new menu which looks like quite cryptic. I cannot find a clear documentation of available API or a User Manual. Can you give me a link to any document could help me to develop JS for Notepad++? Of course, I already know JS but I need a reference of NPP API’s. Thank you in adavnce.
https://github.com/sieukrem/jn-npp-plugin/wiki << just press (Pages 10) button in right site. And for API you see description:
API documentation you find in plugins/jn/API/api.xml
But I’m not sure if this api.xml still exist in actual JN version. I have old copy but can’t upload here.
jN is “specific” because add entries in Menu bar (not in Plugin menu), they cannot be accessed from other plugins, etc. By default, it adds a lot of scripts, if you do not need them, create another folder in the
_off) and put unnecessary scripts in it (or remove them).
I got api.xml but I found really few info, just related to menus. What I am looking for are NPP API’s. For example, I want to duplicate current file, so I want to know which are the methods equivalent to
Get current name to define a new one -> newName = myOwnFuncToGenerate(currName)
Get current folder in case “follow current document” is NOT set --> currFolder
Get current language to use the same ->currLang
Set language to currLang
Save as newName in currFolder
What I cannot find is a REFERENCE to Editor methods and similar.
Ekopalypse last edited by
In api.xml you have some commands for IEditor, you can also check existing scripts have they use this obj.
runMenuCmd(cmd)- runs a specified build-in menu command of Notepad++.
@ArkadiuszMichalski It looks like there is no way to get current file language and set new file to same langua. So gain, what is really missing in Notepad++ is a specific macro language. This plugin is quite cumbersome to use and badly documented.
This plugin is quite cumbersome to use and badly documented.
Not all plugins are created equal.
You do know that plugins are not created/maintained by the same team that does Notepad++, right?
So (a)gain, what is really missing in Notepad++ is a specific macro language.
I think if you try a scripting plugin that is well-done (Pythonscript, LuaScript), you’ll find that your “again” statement is “not strong”.
TroshinDV last edited by TroshinDV