<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Template &quot;new #&quot;]]></title><description><![CDATA[<p dir="auto">Is there a way to specify some template text that will be auto populated in any new document opened.  That is to say “File”-&gt;“New” or just opening Notepad++ when a blank “new 1” show up in a tab.  I’d like some software copyright info to be auto-populated.</p>
<p dir="auto">I’ve added templates with a macro, but those are language-specific by selecting an extension from a text box with NppExec.</p>
<p dir="auto">I’m wondering if “ghost-typing” would help here - but that may be too slow for large text.  Is there a way to change the default content of “new 1” document?</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/17973/template-new</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 21:23:36 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/17973.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Jul 2019 13:59:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Template &quot;new #&quot; on Mon, 09 Sep 2019 23:23:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: Michael-Vincent">@<bdi>Michael-Vincent</bdi></a> said:</p>
<blockquote>
<p dir="auto">Need “manual” intervention</p>
</blockquote>
<p dir="auto"><a href="https://drive.google.com/open?id=1YPxVVp2t8gDyFVRTl7KXuQN5Ok-CJbsc" rel="nofollow ugc">Auto_Populate_x64 plugin</a><br />
<a href="https://drive.google.com/open?id=1D2rfLEPbQgpnAJdJ5I2Kgm9HQTQZ2bip" rel="nofollow ugc">Auto_Populate_x86 plugin</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/46948</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46948</guid><dc:creator><![CDATA[rinku singh]]></dc:creator><pubDate>Mon, 09 Sep 2019 23:23:24 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Wed, 24 Jul 2019 17:17:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: Michael-Vincent">@<bdi>Michael-Vincent</bdi></a></p>
<p dir="auto">Wow.  I bet you are also very good at CMD.exe batch file programming!  :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45592</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45592</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 24 Jul 2019 17:17:05 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Wed, 24 Jul 2019 16:22:28 GMT]]></title><description><![CDATA[<p dir="auto">I solved it a different way.  Need “manual” intervention, but I can run a simple NppExec script in any document and get the copyright inserted:</p>
<pre><code>::template
NPP_CONSOLE keep
NPE_CONSOLE -- v+

SET LOCAL TEMPLATESDIR = $(NPP_DIRECTORY)\plugins\TEMPLATES
SET LOCAL TEMPLATE =

IF "$(ARGC)"=="0" GOTO GETINPUT
IF "$(ARGC)"=="1" THEN
    dir $(TEMPLATESDIR)
    GOTO END
ENDIF
IF "$(ARGC)"&gt;="2" THEN
    IF "$(ARGV[1])"=="__INPUTBOX__" THEN
        GOTO GETINPUT
    ELSE
        SET LOCAL TEMPLATE = $(ARGV[1])
    ENDIF
ENDIF
GOTO EXECUTE

:GETINPUT
INPUTBOX "Template Extension ."
IF "{$(INPUT)}"=="{}" THEN
    cmd /c explorer.exe /e,"$(TEMPLATESDIR)"
    GOTO END
ENDIF
SET LOCAL TEMPLATE = $(INPUT)

:EXECUTE
cmd /c if exist "$(TEMPLATESDIR)\$(TEMPLATE)-TMPL.$(TEMPLATE)" echo "$(TEMPLATESDIR)\$(TEMPLATE)-TMPL.$(TEMPLATE)"
IF "$(OUTPUTL)" != "$(TEMPLATESDIR)\$(TEMPLATE)-TMPL.$(TEMPLATE)" GOTO ERROR
IF "$(TEMPLATE)"~="COPYRIGHT" THEN
    SCI_SENDMSG SCI_GETCURRENTPOS
    SET LOCAL ORIGINALPOS = $(MSG_RESULT)
    // Lines start at 0, but we want to be under shebang line if exists
    // so 0, select 2 characters and compare to #!
    SCI_SENDMSG SCI_GOTOLINE 0
    SCI_SENDMSG SCI_SETCURRENTPOS 2
    IF "$(CURRENT_WORD)"=="#!" THEN
        SCI_SENDMSG SCI_GOTOLINE 1
    ELSE
        // GOTOLINE clears the previous selection
        SCI_SENDMSG SCI_GOTOLINE 0
    ENDIF
    SCI_SENDMSG SCI_GETCURRENTPOS
    SET LOCAL STARTPOS = $(MSG_RESULT)
    SEL_LOADFROM "$(TEMPLATESDIR)\$(TEMPLATE)-TMPL.$(TEMPLATE)"
    SCI_SENDMSG SCI_SETSELECTIONSTART $(STARTPOS)
    NPP_MENUCOMMAND Edit\Comment/Uncomment\Single Line Comment
    SCI_SENDMSG SCI_GOTOPOS $(ORIGINALPOS)
ELSE
    NPP_OPEN "$(TEMPLATESDIR)\$(TEMPLATE)-TMPL.$(TEMPLATE)"
    // cd $(SYS.USERPROFILE)
    NPP_MENUCOMMAND "File\Save As..."
ENDIF
GOTO END

:ERROR
NPP_CONSOLE on
echo No template for `.$(TEMPLATE)' at:
echo $(TEMPLATESDIR)\$(TEMPLATE)-TMPL.$(TEMPLATE)

:END
NPE_CONSOLE -- v-

</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/45588</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45588</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Wed, 24 Jul 2019 16:22:28 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Fri, 19 Jul 2019 18:42:49 GMT]]></title><description><![CDATA[<p dir="auto">No worries - great discussion.  I’ve found <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a>  is my twin apparently:</p>
<blockquote>
<p dir="auto">perlmonk XP</p>
</blockquote>
<blockquote>
<p dir="auto">playing with Perl since the 90s when I started playing with writing cgi scripts for my …edu/~username/ webpage</p>
</blockquote>
<blockquote>
<p dir="auto">the only compiler I have is the mingw-based gcc that comes with the 32 and 64bit versions of strawberry perl</p>
</blockquote>
<p dir="auto">To answer your question - I did install VS2017 Community in order to compile N++ plugins since I could never get the MinGW route working for plugins with dockable components.</p>
<p dir="auto">I too thought of writing a PerlScript plugin by looking at the code for both PythonScript and LuaScript thinking it’d be <em>relatively</em> easy to swap Python | Lua for Perl, but boy was I mistaken!  Hats off to those authors, but I’d still love to see PerlScript someday.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45500</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45500</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Fri, 19 Jul 2019 18:42:49 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Fri, 19 Jul 2019 18:14:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a></p>
<blockquote>
<p dir="auto">My initial skim to the intro of the FFI-Platypus docs make it sound like a way to access an external library (DLL) from within Perl</p>
</blockquote>
<p dir="auto">was my first thought as well but then I read that it is using libffi, as cffi does, then I thought, ok, so it is just to find out how cffi does this internally and then one should be<br />
able to do the same with perl. Hopefully I’m right.</p>
<p dir="auto">But yes, agreed, and sorry <a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: michael-vincent">@<bdi>michael-vincent</bdi></a> for hijacking, enough off topic :-)</p>
<p dir="auto">I should be able to post a little howto on monday/tuesday next week.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45499</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45499</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Fri, 19 Jul 2019 18:14:02 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Fri, 19 Jul 2019 18:03:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> said:</p>
<blockquote>
<p dir="auto">But the best thing was, that this generated a dll, which had the python interpreter included.</p>
</blockquote>
<p dir="auto">Interesting. I’m not sure you’ve said enough for me to understand what you did, or how I would port that over to FFI-Platypus.  But we’ve probably spent to much time hijacking <a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: michael-vincent">@<bdi>michael-vincent</bdi></a>’s thread.</p>
<p dir="auto">My initial skim to the intro of the FFI-Platypus docs make it sound like a way to access an external library (DLL) from within Perl; it doesn’t sound like a way to embed Perl into an external DLL.  But I’m probably misunderstanding what you’ve said, and/or haven’t read enough of the docs to understand its full capability.</p>
<p dir="auto">If you had the time (not necessarily right now, but in the near future), to write up a more detailed sequence of events of how you did that in python / cffi – probably as a post in the <a href="https://notepad-plus-plus.org/community/category/5/plugin-development" rel="nofollow ugc">Plugin Development area</a> – with embedded code or links to github code, I might be able to practice that sequence in python until I understand it, then see if I can replicate it in Perl / FFI-Platypus.  (And that separate topic would give a place to ask questions of each other, and I could share my eventual Perl version, if anything ever came of it.)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45498</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45498</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 19 Jul 2019 18:03:59 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Fri, 19 Jul 2019 17:45:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a></p>
<p dir="auto">Caveat, I don’t know anything about the FFI-Platypus but, recently, I was playing around with cffi, which is a python-ffi and it seems, as far as I’ve understood, that both have the same origin.<br />
With cffi it is, more or less, simple to build a dll.<br />
My first test was something about 50 lines of code and a slightly modified plugin.h, which then was compiled (function within cffi) to a dll.<br />
Npp loaded it and I was able to get a hello world. :-)<br />
But the best thing was, that this generated a dll, which had the python interpreter included.</p>
<p dir="auto">So, with this naive approach in mind and hoping that<br />
Platypus can do the same or similar thing it shouldn’t be that difficult.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45497</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45497</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Fri, 19 Jul 2019 17:45:33 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Fri, 19 Jul 2019 17:31:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> said:</p>
<blockquote>
<blockquote>
<p dir="auto">so I could stop using PythonScript.<br />
Isn’t this already qualifying a ban, or at least a downvote?? :-D</p>
</blockquote>
</blockquote>
<p dir="auto">:-D</p>
<p dir="auto">I’ve been playing with Perl since the 90s when I started playing with writing cgi scripts for my <code>....edu/~username/</code> webpage, so I’m rather more familiar with Perl than Python.  If PerlScript had already existed when I started automating Notepad++, I would have used that rather than PythonScript.  I’d still be a Notepad++ user (which is the most important thing around here), and I’d probably be faster at hacking up scripting solutions for Notepad++ if I could be working in my more familiar language (which would be a bonus around here).</p>
<blockquote>
<p dir="auto">write a small c++ plugin</p>
</blockquote>
<p dir="auto">Therein lies the rub.  I know enough C to hack a c++ program… but I’m not fluent in the ins-and-outs, and the only compiler I have is the mingw-based gcc that comes with the 32 and 64bit versions of strawberry perl.  I’ve never even been able to compile the initial dummy plugin.  (Unfortunately, <a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: Michael-Vincent">@<bdi>Michael-Vincent</bdi></a> [under his previous incarnation of <a class="plugin-mentions-user plugin-mentions-a" href="/user/vinsworldcom178" aria-label="Profile: vinsworldcom178">@<bdi>vinsworldcom178</bdi></a>] never showed progress on <a href="https://notepad-plus-plus.org/community/topic/16149/demo-plugin-docking-not-working-with-mingw-build" rel="nofollow ugc">https://notepad-plus-plus.org/community/topic/16149/demo-plugin-docking-not-working-with-mingw-build</a> , so I never got an example of how to do it. He can confirm, but I think he finally switched to VS2017)</p>
<p dir="auto">Like I said, some day I’d like close communication between the Perl and Notepad++, but it’s a lot of effort, whatever direction you go.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45495</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45495</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 19 Jul 2019 17:31:55 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Fri, 19 Jul 2019 17:14:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a></p>
<blockquote>
<p dir="auto">so I could stop using PythonScript.</p>
</blockquote>
<p dir="auto">Isn’t this already qualifying a ban, or at least a downvote?? :-D</p>
<p dir="auto">I guess a possible way to go would be to write a small c++ plugin which builds<br />
the bridge to <a href="https://github.com/Perl5-FFI/FFI-Platypus" rel="nofollow ugc">FFI-Platypus</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45492</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45492</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Fri, 19 Jul 2019 17:14:24 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Fri, 19 Jul 2019 16:54:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: Michael-Vincent">@<bdi>Michael-Vincent</bdi></a> said:</p>
<blockquote>
<p dir="auto">Now if there was a way to write plugins in Perl … :-)</p>
</blockquote>
<p dir="auto">Amen to that!</p>
<p dir="auto">I kept on hoping that you would at least write the PerlScript plugin, so I could stop using PythonScript.  But I guess since <a href="https://perlmonks.org/?node=pryrt" rel="nofollow ugc">I</a> now have marginally more perlmonk XP than <a href="https://perlmonks.org/?node=VinsWorldcom" rel="nofollow ugc">you</a>, it would be more expected to be me.  But I have the excuse that I’ve never compiled a Notepad++ plugin, and have virutally no experience with <a href="https://perldoc.perl.org/perlguts.html" rel="nofollow ugc">perlguts</a>… so it will probably be a while before I can do it.  (At one point, I at least started a perl module (Win32::Mechanize::NotepadPlusPlus ) to use Win32::API and Win32::GuiTest to automate Notepad++ from <em>outside</em> notepad++, so I don’t have to wait until I learn Notepad++ plugins or  perlguts… but I never get very far.  I am having trouble sending the right messages.  Hmm, maybe one day, I’ll put it into a public github, and see if you or anyone else here or on perlmonks were able to help me see why my messages aren’t working.  But to do that, I’d have to find enough time to remind myself what my cryptic comments mean, and come up with a simple example.  Maybe I’ll try to find the time sooner rather than later. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45489</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45489</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 19 Jul 2019 16:54:13 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Fri, 19 Jul 2019 15:37:35 GMT]]></title><description><![CDATA[<pre><code>IF "new " &lt; "$(FULL_CURRENT_PATH)" THEN
    SEL_SETTEXT "My Copyright (c) 2019"
ENDIF
</code></pre>
<p dir="auto">As a startup in NppExec would do it, but only when N++ first starts, not when “File-&gt;New” from an already opened N++ instance.  To bad <a href="https://raw.githubusercontent.com/MIvanchev/NppEventExec/master/demo/demo.gif" rel="nofollow ugc">NppEventExec</a> wasn’t built into NppExec.  I could add it or just bite the bullet and install (Python | Lua)Script.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45482</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45482</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Fri, 19 Jul 2019 15:37:35 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Fri, 19 Jul 2019 15:10:50 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">aren’t you a known plugin author?</p>
</blockquote>
<p dir="auto">Well that’s a bit of an overstatement of my abilities.  I recognize a difference between talented programmers creating a plugin vs. me taking their source code and adding a few features here and there.  Now if there was a way to write plugins in Perl …  :-)</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45480</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45480</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Fri, 19 Jul 2019 15:10:50 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Fri, 19 Jul 2019 15:07:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: Michael-Vincent">@<bdi>Michael-Vincent</bdi></a></p>
<p dir="auto">I’m doubtful about NppExec for this application, but, maybe?</p>
<p dir="auto">Pythonscript is a bit of a bear to get installed these days.  Luascript is dead-easy to install but I don’t know the equivalent code there.  IIRC aren’t you a known plugin author?  Something like this should be very easy to plugin-ize for someone that has made plugins before…and would have wider shareability. :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45478</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45478</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 19 Jul 2019 15:07:57 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Fri, 19 Jul 2019 15:03:37 GMT]]></title><description><![CDATA[<p dir="auto">Interesting - thanks.  I"m not using PythonScript, but am using NppExec.  Not sure NppExec has a way to receive N++ notifications (e.g., NOTIFICATION.BUFFERACTIVATED); it can send N++ messages.</p>
<p dir="auto">I"ll poke a bit with your idea on NppExec to see if I can do it with that plugin.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45477</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45477</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Fri, 19 Jul 2019 15:03:37 GMT</pubDate></item><item><title><![CDATA[Reply to Template &quot;new #&quot; on Fri, 19 Jul 2019 14:08:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: Michael-Vincent">@<bdi>Michael-Vincent</bdi></a></p>
<p dir="auto">If you’re a Pythonscripter, you could certainly install something like this via your <a href="http://startup.py" rel="nofollow ugc">startup.py</a>:</p>
<pre><code>def callback_npp_BUFFERACTIVATED(args):
    if editor.getTextLength() == 0: editor.setText('my great copyright notice...blah...blah...')

notepad.callback(callback_npp_BUFFERACTIVATED, [NOTIFICATION.BUFFERACTIVATED])
</code></pre>
<p dir="auto">Note that I didn’t check the name of the file for “new” but one could certainly add some logic for that if desired.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45476</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45476</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 19 Jul 2019 14:08:45 GMT</pubDate></item></channel></rss>