<?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[Macro does not record my Run action]]></title><description><![CDATA[<p dir="auto">Hi,<br />
first time recoding a macro.<br />
I have prepared a sequence of actions, the main of which is to run (with menu &gt; Run &gt; Run) a certain command invoking an external tool.<br />
But Macro fails to record the Run part.</p>
<p dir="auto">Are macros supposed to be able to record Run actions at all?</p>
<p dir="auto">I have read the manual on Macros, as well as the FAQ pages in the community about Macro and haven’t seen Run actions mentioned specifically.</p>
<p dir="auto">I tried recording the Run action in isolation, in several ways:</p>
<ul>
<li>by using a shortcut key assigned to that Run action,</li>
<li>by navigating to Run &gt; Run… where the command to run was already typed in</li>
<li>by navigating to Run menu where my command was saved with its own menu entry</li>
</ul>
<p dir="auto">Thanks</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27104/macro-does-not-record-my-run-action</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 04:38:03 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27104.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 27 Aug 2025 00:32:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Macro does not record my Run action on Tue, 02 Sep 2025 01:37:12 GMT]]></title><description><![CDATA[<p dir="auto">@Victorel-Petrovich Another good idea: <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/8037" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/issues/8037</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/103117</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103117</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Tue, 02 Sep 2025 01:37:12 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Sat, 30 Aug 2025 23:44:42 GMT]]></title><description><![CDATA[<p dir="auto">@Victorel-Petrovich said in <a href="/post/103084">Macro does not record my Run action</a>:</p>
<blockquote>
<p dir="auto">It’s also about the long term vision for Macros: is it desirable to make them more powerful, to give more power to the average user that doesn’t have time to learn scripting, or not?</p>
</blockquote>
<p dir="auto"><a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4809#issuecomment-3239606439" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4809#issuecomment-3239606439</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/103098</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103098</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Sat, 30 Aug 2025 23:44:42 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Sat, 30 Aug 2025 03:11:31 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> it just seems to you so. Just like it seems to you that my ideas are “great” and “grand”.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103089</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103089</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Sat, 30 Aug 2025 03:11:31 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Sat, 30 Aug 2025 00:40:07 GMT]]></title><description><![CDATA[<p dir="auto">@Victorel-Petrovich</p>
<p dir="auto">How come it seems like the people will all these grand ideas for how the code should be changed have no ability to do it?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103088</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103088</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 30 Aug 2025 00:40:07 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Fri, 29 Aug 2025 21:45:55 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> if I knew it, I would.<br />
Another big part is being more or less familiar with the organization and specifics of N++ code.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103087</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103087</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 29 Aug 2025 21:45:55 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Fri, 29 Aug 2025 20:24:23 GMT]]></title><description><![CDATA[<p dir="auto">@Victorel-Petrovich said:</p>
<blockquote>
<p dir="auto">I already found some raw initial algorithms for making the user’s menu-command IDs constant</p>
</blockquote>
<p dir="auto">Great.</p>
<blockquote>
<p dir="auto">if other people want to work with the C++ part.</p>
</blockquote>
<p dir="auto">Why not YOU?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103086</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103086</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 29 Aug 2025 20:24:23 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Fri, 29 Aug 2025 20:58:08 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> Since there is no official list of what is supposed to work/ be recordable with macros and what not, I don’t think there is any “contract” here.<br />
My impression is that, at least with regards to these dynamic-ID menu commands, the current situation is simply a result of the coding solutions that were deemed good-enough long time ago and then the developers never had enough time/incentive to change it.</p>
<p dir="auto">But if enough people will agree that macros become much more powerful by including any Run/Macro/Plugin commands, then N++ code could be changed, for the better.</p>
<p dir="auto">It’s also about the long term vision for Macros: is it desirable to make them more powerful, to give more power to the average user that doesn’t have time to learn scripting, or not?<br />
(IMO, it makes it easier even for those who know scripting)</p>
<p dir="auto">I already found some raw initial algorithms for making the user’s menu-command IDs constant - if other people want to work with the C++ part.</p>
<blockquote>
<p dir="auto">I’m not sure he’s noticed how much I abuse the macro system</p>
</blockquote>
<p dir="auto">I don’t think you are abusing it; you’re simply working around the current limitations.<br />
That’s normal: any software has limitations; no software is perfect from the get-go. It evolves.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103084</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103084</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 29 Aug 2025 20:58:08 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Fri, 29 Aug 2025 14:59:47 GMT]]></title><description><![CDATA[<p dir="auto">@Victorel-Petrovich said in <a href="/post/103080">Macro does not record my Run action</a>:</p>
<blockquote>
<p dir="auto">shouldn’t <code>sParam</code> be <code>""</code> ?</p>
</blockquote>
<p dir="auto">That would be better, yes.  They ignore the sParam unless it’s one of the string-related actions, but for consistency’s sake, it should just be <code>""</code>.  (I copy/pasted the line from a different macro, and didn’t notice it has the <code>sParam="0"</code> for that one)</p>
<blockquote>
<p dir="auto">The menu ID for a command should be kept constant.</p>
</blockquote>
<p dir="auto">That would be the easiest, from the hacker perspective.  But since we are breaking the macro “contract” by trying to include non-recorded actions in a macro, we’re already past the edge into unsupported behavior; I am doubtful that storing/allocating a “constand commandID” in the XML would be implemented just to support a few hackers who aren’t following the intended behavior of macros.</p>
<p dir="auto">I believe that the “official position” is that if you are doing something that doesn’t work with a recorded macro, you should instead switch to something like NppExec or PyhonScript plugins, instead of trying to use the macro system.  I’m not sure he’s noticed how much I abuse the macro system, nor the fact that I have a FAQ explaining it. ;-)  And I am really not sure I want this pointed out to him, lest he close the security gaps in the macro system.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103082</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103082</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 29 Aug 2025 14:59:47 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Fri, 29 Aug 2025 05:25:09 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><br />
Great walk-through.<br />
You knew how the menu IDs are assigned, so you were able to design the proper experiment.</p>
<p dir="auto">I have just performed an equivalent one where I created 2 Run-menu actions, then manually included the second one in a macro; tested fine; then deleted the first Run-menu action and restarted N++.<br />
When calling my macro, it, predictably, failed for the reasons you mentioned (in fact, it crashed N++).</p>
<p dir="auto">A question in your step 3 above:</p>
<blockquote>
<pre><code>&lt;Macro name="Do BC" Ctrl="no" Alt="no" Shift="no" Key="0"&gt;
        &lt;Action type="2" message="0" wParam="20002" lParam="0" sParam="0" /&gt;
        &lt;Action type="2" message="0" wParam="20003" lParam="0" sParam="0" /&gt;
    &lt;/Macro&gt;
</code></pre>
</blockquote>
<p dir="auto">shouldn’t <code>sParam</code> be <code>""</code> ? based on <a href="https://npp-user-manual.org/docs/config-files/#attributes-for-the-action-tag" rel="nofollow ugc">https://npp-user-manual.org/docs/config-files/#attributes-for-the-action-tag</a><br />
Same in your example in <a href="https://community.notepad-plus-plus.org/topic/25400/faq-automating-notepad/2?_=1756438181968">https://community.notepad-plus-plus.org/topic/25400/faq-automating-notepad/2?_=1756438181968</a></p>
<p dir="auto">Now to the main part:</p>
<blockquote>
<p dir="auto">It is 100% repeatable: it renumbered the macros every time one was inserted or deleted from the sequence, invalidating the wParam value used.</p>
</blockquote>
<p dir="auto">Same happens when Run-menu items are inserted/removed from that menu; I guess similar thing happens with plugin menu.</p>
<p dir="auto">This pinpoints the core issue and also a possible solution/ fix to N++ code  that deals with menu ID (re)assignments:<br />
<em>The menu ID for a command <em>should</em> be kept constant.</em></p>
<p dir="auto">(Up until that command is removed by the user.)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103080</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103080</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 29 Aug 2025 05:25:09 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Fri, 29 Aug 2025 01:45:16 GMT]]></title><description><![CDATA[<p dir="auto">@Victorel-Petrovich said in <a href="/post/103076">Macro does not record my Run action</a>:</p>
<blockquote>
<p dir="auto">What do you think ?</p>
</blockquote>
<p dir="auto">I think your experiment was not sufficient.</p>
<ol>
<li>Start with three recorded macros (A,B,C, which just type the character of the name), restart</li>
<li>Use NppUISpy! to see that those macros are <code>20001</code>, <code>20002</code>, <code>20003</code><br />
<img src="/assets/uploads/files/1756431725717-090a41e3-c610-4ad9-b0f6-3048e47a0be6-image.png" alt="090a41e3-c610-4ad9-b0f6-3048e47a0be6-image.png" class=" img-fluid img-markdown" /></li>
<li>Manually edit a new macro called “Do BC” which calls B and C<pre><code>&lt;Macros&gt;
    &lt;Macro name="Trim Trailing Space and Save" Ctrl="no" Alt="yes" Shift="yes" Key="83"&gt;
        &lt;Action type="2" message="0" wParam="42024" lParam="0" sParam="" /&gt;
        &lt;Action type="2" message="0" wParam="41006" lParam="0" sParam="" /&gt;
    &lt;/Macro&gt;
    &lt;Macro name="A" Ctrl="no" Alt="no" Shift="no" Key="0"&gt;
        &lt;Action type="1" message="2170" wParam="0" lParam="0" sParam="A" /&gt;
    &lt;/Macro&gt;
    &lt;Macro name="B" Ctrl="no" Alt="no" Shift="no" Key="0"&gt;
        &lt;Action type="1" message="2170" wParam="0" lParam="0" sParam="B" /&gt;
    &lt;/Macro&gt;
    &lt;Macro name="C" Ctrl="no" Alt="no" Shift="no" Key="0"&gt;
        &lt;Action type="1" message="2170" wParam="0" lParam="0" sParam="C" /&gt;
    &lt;/Macro&gt;
    &lt;Macro name="Do BC" Ctrl="no" Alt="no" Shift="no" Key="0"&gt;
        &lt;Action type="2" message="0" wParam="20002" lParam="0" sParam="0" /&gt;
        &lt;Action type="2" message="0" wParam="20003" lParam="0" sParam="0" /&gt;
    &lt;/Macro&gt;
&lt;/Macros&gt;
</code></pre>
</li>
<li>Restart and use NppUISpy to see the new macro is <code>20004</code>.  (Verified the macro worked, typing <code>BC</code>)<br />
<img src="/assets/uploads/files/1756431772157-46c00fb4-68db-4745-8b3b-a03d580cdd26-image.png" alt="46c00fb4-68db-4745-8b3b-a03d580cdd26-image.png" class=" img-fluid img-markdown" /></li>
<li>Edit shortcuts.xml, delete macro “A”, save, Exit Notepad++, restart Notepad++</li>
<li>See that NppUISpy now lists B as <code>20001</code> and C as <code>20002</code> and “Do BC” as <code>20003</code><br />
<img src="/assets/uploads/files/1756431798651-c9fe8fcc-00b6-458b-b029-afe87a4d83b8-image.png" alt="c9fe8fcc-00b6-458b-b029-afe87a4d83b8-image.png" class=" img-fluid img-markdown" /></li>
<li>Run “Do BC” and see it type <code>C</code> a number of times: it’s running <code>20002</code> to get “C”, then it runs <code>20003</code>, which recursively calling itself until it hits an internal recursion limit</li>
</ol>
<p dir="auto">I tried this multiple times, in various combinations.  It is 100% repeatable: it renumbered the macros every time one was inserted or deleted from the sequence, invalidating the <code>wParam</code> value used.</p>
<p dir="auto">Like with the <code>LF</code> vs <code>CRLF</code>, I think you happened to be in the “lucky” circumstance where your experiment happened to work.  In general, you cannot rely on the the menuCmdID for any given macro staying the same if you change the number or order of macros.  Telling other people that it’s okay to rely on that is to tell them to invite disaster.</p>
<p dir="auto">Hence, the FAQ will continue to state that if you change the number of Macros (Run commands, or add/remove/update plugins), you should <strong>always</strong> check to make sure the menu command ID hasn’t changed, otherwise your macro will quite possibly <strong>not</strong> do what was intended, once circumstances change.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103078</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103078</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 29 Aug 2025 01:45:16 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Thu, 28 Aug 2025 23:25:44 GMT]]></title><description><![CDATA[<p dir="auto">It worked, based on the example in “How to Cheat the Macro System”.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> Moreover, it continued to work even after I deleted another menu entry in Macro , located before the one I’m using one, plus experimtentally added then deleted several other saved macros and saved Run-menu actions and also after uninstalling a plugin and then after reinstalling it. Everytime restarting N++.</p>
<p dir="auto">So it appears to me that in principle, Macro involving Run-menu actions should be recordable: the fact that the menu ID is dynamic does not affect the saved macro. Perhaps the same is true if the macro involves other macros and plugin actions.<br />
The only case I can think of where the dynamic nature of a menu-command ID can ruin the saved macro is that it involves a plugin script and then you uninstall that plugin.<br />
What do you think ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103076</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103076</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 28 Aug 2025 23:25:44 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Wed, 27 Aug 2025 04:07:59 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> Thanks for the fast reply and clarifications.<br />
“Obvious” is a dangerous word, our math prof used to say. I think you know much more about N++ than the average user.<br />
If you want to make it clearer for others, you can change this subfaq’s title <a href="https://community.notepad-plus-plus.org/topic/25400/faq-automating-notepad/2?_=1756262523622">https://community.notepad-plus-plus.org/topic/25400/faq-automating-notepad/2?_=1756262523622</a><br />
to something like “Using Plugin, Run-menu and Macro Commands in Macros”<br />
And this <a href="https://npp-user-manual.org/docs/macros/" rel="nofollow ugc">https://npp-user-manual.org/docs/macros/</a> would benefit from a link to <a href="https://community.notepad-plus-plus.org/topic/25400/faq-automating-notepad">https://community.notepad-plus-plus.org/topic/25400/faq-automating-notepad</a></p>
<p dir="auto">Thank you for the detailed documentation, anyway.</p>
<p dir="auto">I’m going to give a try to manually editing my macro and will report here.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103050</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103050</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 27 Aug 2025 04:07:59 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Wed, 27 Aug 2025 01:31:03 GMT]]></title><description><![CDATA[<p dir="auto">@Victorel-Petrovich said in <a href="/post/103047">Macro does not record my Run action</a>:</p>
<blockquote>
<p dir="auto">I have read the manual on Macros, as well as the FAQ pages in the community about Macro and haven’t seen Run actions mentioned specifically.</p>
</blockquote>
<p dir="auto">Sorry, I had thought it would be obvious that the “How to Cheat the Macro System” section of the FAQ would be applicable to <em>anything</em> that needs dynamic menu entries, including Plugins, saved <strong>Run</strong>-menu commands, or calling other Macros from your macro, even though the FAQ previously only mentioned Plugin commands.  However, since it apparently wasn’t obvious, I have clarified the FAQ now: the same method can be used to playback saved Run-menu actions in a Macro, or to playback other saved Macros in a macro.</p>
<p dir="auto">But, because they don’t have fixed menu command IDs, Plugin commands, saved <strong>Run</strong>-menu actions, and saved Macros will <em>never</em> be macro-recordable; you will always have to manually edit a macro to be able to playback any dynamic-ID commands.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103049</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103049</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 27 Aug 2025 01:31:03 GMT</pubDate></item><item><title><![CDATA[Reply to Macro does not record my Run action on Wed, 27 Aug 2025 00:43:06 GMT]]></title><description><![CDATA[<p dir="auto">@Victorel-Petrovich said in <a href="/post/103047">Macro does not record my Run action</a>:</p>
<blockquote>
<p dir="auto">Are macro supposed to be able to record Run actions at all?</p>
</blockquote>
<p dir="auto">I can’t answer that but one of our regulars did some investigations a short time ago. Read <a href="https://community.notepad-plus-plus.org/topic/27029/macros-to-find-foward-the-next-character/7?_=1756235076916">his post here</a> on what he found out.</p>
<p dir="auto">In essence there is no definitive list of non-recordable commands.</p>
<p dir="auto">Terry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/103048</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103048</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Wed, 27 Aug 2025 00:43:06 GMT</pubDate></item></channel></rss>