Peter provided a macro, but looking at it, you can’t easily tell what it does (of course, Peter describes it, but what if he didn’t?).
I’ve been working on a macro “disassembler” that will help to reverse-engineer a provided macro, or even let you just recall what your own macros actually do.
Here’s what my in-progress tool produces for Peter’s macro:
<Macro name="Replace First Line with Filename" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="0" message="2316" wParam="0" lParam="0" sParam="" /> SCI_DOCUMENTSTART <Action type="0" message="2338" wParam="0" lParam="0" sParam="" /> SCI_LINEDELETE <Action type="2" message="0" wParam="42030" lParam="0" sParam="" /> IDM_EDIT_FILENAMETOCLIP <Action type="0" message="2179" wParam="0" lParam="0" sParam="" /> SCI_PASTE <Action type="1" message="2170" wParam="0" lParam="0" sParam="\r" /> SCI_REPLACESEL <Action type="1" message="2170" wParam="0" lParam="0" sParam="\n" /> SCI_REPLACESEL <Action type="2" message="0" wParam="41006" lParam="0" sParam="" /> IDM_FILE_SAVE <Action type="2" message="0" wParam="41003" lParam="0" sParam="" /> IDM_FILE_CLOSEIt does require a bit of N++ “smarts” to know what things like SCI_REPLACESEL and IDM_EDIT_FILENAMETOCLIP mean, but it isn’t a real stretch of the imagination that even noobs could figure it out.