Can I have either a macro or a run command that will launch an external exe with parameters including $(FULL_CURRENT_PATH) and then after it executes run a macro? I would want the macro to create a new NPP document and then paste into that blank document. After the external command is executed, the windows clipboard will contain text that I want in the new document.
I can't find any mention of whether this is possible or not in the forums or in the npp-community site.
Check out nppexec :-
SET OUTFILE = C:\temp\dig.txt
cmd /c "C:\Windows\System32\dns\bin\dig" $(CURRENT_WORD) @220.127.116.11 >>$(OUTFILE)
Something I did to do dns lookup of the selected test in one notepad++ tab and create a new tab with the output.
There are several ways.
1/ Use an external macro manager, like AutoHotKey or similar, to send the various commands (N++: create new document ; launch external program ; N++: paste in current document.
2/ Minimise N++ in systray, run program and then use right click menu to create new file from clipboard
3/ Use the RunMe plugin to apply external program to (a copy of) your current document.
4/ I'd suspect Python Script can do something about it, but I hardly know Python.
I haven't used the Pork2Sausage plugin much, it might help too.
Thanks - the NPP_EXEC plugin will do what I want - instead of creating a document with the output I just wanted the output to go directly to a new NPP document, so this example works:
// enable the $(OUTPUT) variable
// your command here... for example, let it be "cmd /?"
// open new tab
NPP_SENDMSG WM_COMMAND IDM_FILE_NEW
// set the text in the new tab
// finally, disable $(OUTPUT) variable
This actually lets me skip a step - I was calling a batch file that piped std out to the Cygwin utility putclip.exe in order to get the output into the clipboard for pasting, but using this method with NPP_EXEC the output goes directly into a new document without having to use the putclip utility.
I was looking for a way for a builtin NPP macro to call a run command or for the run command to call a macro but NPP_EXEC will let me combine it all into one. The only problem is the difficulty of finding documentation on all the available commands.