<?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[Can I create a macro that gives the desired file name when creating a new file?]]></title><description><![CDATA[<p dir="auto">Hello to all participants of the forum!<br />
For example, this macro creates a new OEM 866 encoded file for batch, but the file name will always be “new 1”. The file name “new.bat” is required to have a file extension.</p>
<pre><code>        &lt;Macro name="NEW.BAT" Ctrl="no" Alt="no" Shift="no" Key="0"&gt;
            &lt;Action type="2" message="0" wParam="41001" lParam="0" sParam="" /&gt;
            &lt;Action type="2" message="0" wParam="46022" lParam="0" sParam="" /&gt;
            &lt;Action type="2" message="0" wParam="45058" lParam="0" sParam="" /&gt;
        &lt;/Macro&gt;
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/topic/22030/can-i-create-a-macro-that-gives-the-desired-file-name-when-creating-a-new-file</link><generator>RSS for Node</generator><lastBuildDate>Wed, 13 May 2026 21:35:52 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/22030.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Oct 2021 04:39:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Can I create a macro that gives the desired file name when creating a new file? on Wed, 01 Mar 2023 14:59:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> said in <a href="/post/70797">Can I create a macro that gives the desired file name when creating a new file?</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andrecool-68" aria-label="Profile: andrecool-68">@<bdi>andrecool-68</bdi></a> said in Can I create a macro that gives the desired file name when creating a new file?:</p>
<p dir="auto">but the file name will always be “new 1”.</p>
<p dir="auto">I don’t think that’s going to always be true.  It would depend upon if you already had an existing new 1 file when this macro is run, then I don’t think what the macro will saw will be saved in new 1.<br />
For this kind of automation it is probably best to go with the scripting plugins (e.g. PythonScript) or presumably NppExec can also achieve it.</p>
</blockquote>
<p dir="auto">thanks my issue has been fixed.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/84515</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/84515</guid><dc:creator><![CDATA[mark Loss]]></dc:creator><pubDate>Wed, 01 Mar 2023 14:59:23 GMT</pubDate></item><item><title><![CDATA[Reply to Can I create a macro that gives the desired file name when creating a new file? on Sun, 24 Oct 2021 11:48:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> For me Python, is a dark forest.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70854</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70854</guid><dc:creator><![CDATA[andrecool-68]]></dc:creator><pubDate>Sun, 24 Oct 2021 11:48:34 GMT</pubDate></item><item><title><![CDATA[Reply to Can I create a macro that gives the desired file name when creating a new file? on Fri, 22 Oct 2021 11:27:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andrecool-68" aria-label="Profile: andrecool-68">@<bdi>andrecool-68</bdi></a> said in <a href="/post/70791">Can I create a macro that gives the desired file name when creating a new file?</a>:</p>
<blockquote>
<p dir="auto">but the file name will always be “new 1”.</p>
</blockquote>
<p dir="auto">I don’t think that’s going to always be true.  It would depend upon if you already had an existing <code>new 1</code> file when this macro is run, then I don’t think what the macro will saw will be saved in <code>new 1</code>.</p>
<p dir="auto">For this kind of automation it is probably best to go with the scripting plugins (e.g. PythonScript) or presumably NppExec can also achieve it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70797</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70797</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 22 Oct 2021 11:27:14 GMT</pubDate></item><item><title><![CDATA[Reply to Can I create a macro that gives the desired file name when creating a new file? on Fri, 22 Oct 2021 05:36:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andrecool-68" aria-label="Profile: andrecool-68">@<bdi>andrecool-68</bdi></a> said in <a href="/post/70791">Can I create a macro that gives the desired file name when creating a new file?</a>:</p>
<blockquote>
<p dir="auto">The file name “new.bat” is required to have a file extension.</p>
</blockquote>
<p dir="auto">You may want to read from <a href="https://community.notepad-plus-plus.org/topic/20583/page-break-text-file-saving/13">this thread</a> in this forum. I had thought the same as you, however the macro failed as the files are ONLY resident within NPP, not real files.</p>
<p dir="auto">There was some talk later in that thread that it was possible to edit the macro to include the Save As step, although it is not recordable in the normal sense. I don’t think I followed through much on that so can’t confirm there is a path forward to achieve what you want.</p>
<p dir="auto">Another idea that might work is to have an empty “template” file with the extension, so a real file. Have the macro load that, then rename, or save a copy as, would that work???</p>
<p dir="auto">Good luck<br />
Terry</p>
<p dir="auto">PS if successful could you provide the info here as I think there will be many wanting to know how it might be achieved.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70792</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70792</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Fri, 22 Oct 2021 05:36:08 GMT</pubDate></item></channel></rss>