<?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[Recording: How can I change the regex operations in MACRO?]]></title><description><![CDATA[<p dir="auto">hello, again. how can I change the regex operations in MACROS, to record something extra on the same macro?</p>
<p dir="auto">Seems that I cannot do that. Or, can be done?</p>
<p dir="auto"><img src="/assets/uploads/files/1648545226454-7b5a7531-9481-4b66-9c15-300b56491392-image.png" alt="7b5a7531-9481-4b66-9c15-300b56491392-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/22781/recording-how-can-i-change-the-regex-operations-in-macro</link><generator>RSS for Node</generator><lastBuildDate>Mon, 12 Oct 2026 18:04:35 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/22781.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 29 Mar 2022 09:14:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Recording: How can I change the regex operations in MACRO? on Tue, 29 Mar 2022 13:50:04 GMT]]></title><description><![CDATA[<p dir="auto">@neculai-i-fantanaru said in <a href="/post/75576">Recording: How can I change the regex operations in MACRO?</a>:</p>
<blockquote>
<p dir="auto">The location of shortcuts.xml is</p>
</blockquote>
<p dir="auto">That isn’t an absolute.  Maybe for you it is, but it depends upon your setup.  If you look at your <em>Debug Info…</em> (on the <code>?</code> main menu), example:</p>
<p dir="auto"><code>Local Conf mode : OFF</code></p>
<p dir="auto">then yes it is in <code>%APPDATA%\Notepad++</code>.</p>
<p dir="auto">but if it says:</p>
<p dir="auto"><code>Local Conf mode : ON</code></p>
<p dir="auto">then it is in the same folder as <code>notepad++.exe</code>.</p>
<p dir="auto">Also, there is more info on “appdata” <a href="https://community.notepad-plus-plus.org/topic/15740/faq-desk-what-is-appdata">HERE</a> … I should have pointed that out before.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/75577</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/75577</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 29 Mar 2022 13:50:04 GMT</pubDate></item><item><title><![CDATA[Reply to Recording: How can I change the regex operations in MACRO? on Tue, 29 Mar 2022 13:40:13 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></p>
<p dir="auto">Yes, indeed. The location of shortcuts.xml is:</p>
<p dir="auto"><code>c:\Users\COMPUTER\AppData\Roaming\Notepad++\</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/75576</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/75576</guid><dc:creator><![CDATA[Neculai I. Fantanaru]]></dc:creator><pubDate>Tue, 29 Mar 2022 13:40:13 GMT</pubDate></item><item><title><![CDATA[Reply to Recording: How can I change the regex operations in MACRO? on Tue, 29 Mar 2022 13:27:31 GMT]]></title><description><![CDATA[<p dir="auto">@neculai-i-fantanaru said in <a href="/post/75572">Recording: How can I change the regex operations in MACRO?</a>:</p>
<blockquote>
<p dir="auto">The problem is when I open shortcuts.xml, I cannot find the macros which I saved (see picture 2)</p>
</blockquote>
<p dir="auto">The shortcuts file that your N++ is probably using is in the <code>%APPDATA%\Notepad++</code> folder.  Paste that into an Explorer window to quickly go there and check that file.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/75575</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/75575</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 29 Mar 2022 13:27:31 GMT</pubDate></item><item><title><![CDATA[Reply to Recording: How can I change the regex operations in MACRO? on Tue, 29 Mar 2022 13:26:43 GMT]]></title><description><![CDATA[<p dir="auto">@neculai-i-fantanaru said in <a href="/post/75572">Recording: How can I change the regex operations in MACRO?</a>:</p>
<blockquote>
<p dir="auto">thank you all. But there is a problem. I already made 2 macros, and save them. See picture 1. The problem is when I open shortcuts.xml, I cannot find the macros which I saved (see picture 2)</p>
</blockquote>
<p dir="auto">The <strong>Macro &gt; Save Current Recorded Macro…</strong> action saves to memory.  It is not until you exit out of Notepad++ that the macro gets moved from memory to <code>shortcuts.xml</code>.  If you want to see the macro in <code>shortcuts.xml</code>, you have to exit Notepad++ first.  See also the User Manual’s section on <a href="https://npp-user-manual.org/docs/config-files/#editing-configuration-files" rel="nofollow ugc">Editing Configuration Files</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/75574</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/75574</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 29 Mar 2022 13:26:43 GMT</pubDate></item><item><title><![CDATA[Reply to Recording: How can I change the regex operations in MACRO? on Tue, 29 Mar 2022 13:21:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said in <a href="/post/75571">Recording: How can I change the regex operations in MACRO?</a>:</p>
<blockquote>
<p dir="auto">according to the following template :</p>
</blockquote>
<p dir="auto">Nice roadmap, it goes well with the user manual link I provided before.</p>
<p dir="auto">One thing, though:  the 1702 … to turn “on” these options in combination, one has to add the numbers – example: to do a match-whole-word and match-case search, one has to use <code>1 + 2</code>, but you do the math ahead of time (<code>3</code>) and put that in the macro text.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/75573</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/75573</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 29 Mar 2022 13:21:15 GMT</pubDate></item><item><title><![CDATA[Reply to Recording: How can I change the regex operations in MACRO? on Tue, 29 Mar 2022 13:20:02 GMT]]></title><description><![CDATA[<p dir="auto">thank you all. But there is a problem. I already made 2 macros, and save them. See picture 1. The problem is when I open <code>shortcuts.xml</code>, I cannot find the macros which I saved (see picture 2)</p>
<p dir="auto"><img src="/assets/uploads/files/1648559919905-2641f986-555f-417e-9eab-b5506dfdeab1-image.png" alt="2641f986-555f-417e-9eab-b5506dfdeab1-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1648559886062-8c8d76d9-1c9f-4f62-b659-6fcb38630b54-image.png" alt="8c8d76d9-1c9f-4f62-b659-6fcb38630b54-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/75572</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/75572</guid><dc:creator><![CDATA[Neculai I. Fantanaru]]></dc:creator><pubDate>Tue, 29 Mar 2022 13:20:02 GMT</pubDate></item><item><title><![CDATA[Reply to Recording: How can I change the regex operations in MACRO? on Thu, 24 Nov 2022 15:30:43 GMT]]></title><description><![CDATA[<p dir="auto">Hello, @neculai-i-fantanaru, <a class="plugin-mentions-user plugin-mentions-a" href="/user/neil-schipper" aria-label="Profile: neil-Schipper">@<bdi>neil-Schipper</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">If you know where is your <strong>active</strong> <strong><code>shortcuts.xml</code></strong> configuration file, it’s <strong>not</strong> very difficult ! Here is the road map :</p>
<ul>
<li>
<p dir="auto">Open your <strong>active</strong> <strong><code>shortcuts.xml</code></strong> file in <strong>Notepad++</strong></p>
</li>
<li>
<p dir="auto">Inside the <strong><code>&lt;Macros&gt;................&lt;/Macros&gt;</code></strong> node, find the <strong>specific</strong> macro that you want to modify</p>
</li>
<li>
<p dir="auto">Modify it, according to the following <strong>template</strong> :</p>
</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1648559636568-1ea13e45-0766-4850-a0dd-b1d01759e2f9-codage_rech_remp.jpg" alt="1ea13e45-0766-4850-a0dd-b1d01759e2f9-Codage_Rech_Remp.jpg" class=" img-fluid img-markdown" /></p>
<ul>
<li>
<p dir="auto">Save the modifications of the <strong><code>shortcuts.xml</code></strong> file</p>
</li>
<li>
<p dir="auto">Stop and <strong>restart</strong> notepad++ ( <em>IMPORTANT</em> )</p>
</li>
<li>
<p dir="auto">Excecute your <strong>modified</strong> macro !</p>
</li>
</ul>
<hr />
<p dir="auto">Note that you may insert <strong>several consecutive</strong> regex searches/marks/replacements in a <strong>same</strong> macro !</p>
<p dir="auto">For instance, the macro, below, named <strong><code>Test</code></strong> :</p>
<pre><code class="language-xml">        &lt;Macro name="Test" Ctrl="no" Alt="no" Shift="no" Key="0"&gt;
            &lt;Action type="3" message="1700" wParam="0" lParam="0" sParam="" /&gt;
            &lt;Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-s)\h+$" /&gt;
            &lt;Action type="3" message="1625" wParam="0" lParam="2" sParam="" /&gt;
            &lt;Action type="3" message="1602" wParam="0" lParam="0" sParam="" /&gt;
            &lt;Action type="3" message="1702" wParam="0" lParam="768" sParam="" /&gt;
            &lt;Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /&gt;

            &lt;Action type="3" message="1700" wParam="0" lParam="0" sParam="" /&gt;
            &lt;Action type="3" message="1601" wParam="0" lParam="0" sParam="\[(\w+)\]|\((\w+)\)|\{(\w+)\}" /&gt;
            &lt;Action type="3" message="1625" wParam="0" lParam="2" sParam="" /&gt;
            &lt;Action type="3" message="1602" wParam="0" lParam="0" sParam="&amp;#x2014; \1\2\3 &amp;#x2014;" /&gt;
            &lt;Action type="3" message="1702" wParam="0" lParam="768" sParam="" /&gt;
            &lt;Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /&gt;

            &lt;Action type="3" message="1700" wParam="0" lParam="0" sParam="" /&gt;
            &lt;Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-s)(.|\r\n)\z" /&gt;
            &lt;Action type="3" message="1625" wParam="0" lParam="2" sParam="" /&gt;
            &lt;Action type="3" message="1602" wParam="0" lParam="0" sParam="\r\n&amp;#x00A9; 2022 - Neculai I. Fantanaru\r\n" /&gt;
            &lt;Action type="3" message="1702" wParam="0" lParam="768" sParam="" /&gt;
            &lt;Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /&gt;
        &lt;/Macro&gt;
</code></pre>
<p dir="auto">would perform the <strong><code>3</code></strong> following actions :</p>
<ul>
<li>
<p dir="auto"><strong>Suppression</strong> of all possible <strong>trailing</strong> <strong><code>space</code></strong> chars</p>
</li>
<li>
<p dir="auto"><strong>Replacement</strong> of any word between <strong>parentheses</strong>, <strong>square</strong> brackets and <strong>braces</strong> with an <strong><code>EM dash</code></strong> char, a <strong><code>space</code></strong>  char, the <strong>present</strong> word, a <strong><code>space</code></strong> char and a final <strong><code>EM dash</code></strong> char</p>
</li>
<li>
<p dir="auto"><strong>Insertion</strong> of the line <strong><code>© 2022 - Neculai I. Fantanaru</code></strong> with its <strong>line-ending</strong> chars, at the <strong>very end</strong> of a <strong><code>Normal</code></strong> text file</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/75571</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/75571</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 24 Nov 2022 15:30:43 GMT</pubDate></item><item><title><![CDATA[Reply to Recording: How can I change the regex operations in MACRO? on Tue, 29 Mar 2022 11:22:00 GMT]]></title><description><![CDATA[<p dir="auto">@neculai-i-fantanaru said in <a href="/post/75563">Recording: How can I change the regex operations in MACRO?</a>:</p>
<blockquote>
<p dir="auto">how can I change the regex operations in MACROS, to record something extra on the same macro?</p>
</blockquote>
<p dir="auto">Perhaps “extra” here means an additional replacement operation, so one macro would do two or more in succession?</p>
<p dir="auto">If so, very possible, with hand-editing of the <code>shortcuts.xml</code> file as Neil discussed.</p>
<p dir="auto">In that file, a single search/replace operation begins with <code>message="1700"</code> and ends with <code>message="1701"</code>.</p>
<p dir="auto">As long as you move that “block” of lines together as a unit, you can combine as many replacement operations as you need together in one macro.</p>
<p dir="auto">Of course, be careful in editing this file, and probably make a backup before beginning.</p>
<p dir="auto">There are more details on how the searching macros are encoded, in the user manual <a href="https://npp-user-manual.org/docs/searching/#searching-actions-when-recorded-as-macros" rel="nofollow ugc">HERE</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/75566</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/75566</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 29 Mar 2022 11:22:00 GMT</pubDate></item><item><title><![CDATA[Reply to Recording: How can I change the regex operations in MACRO? on Tue, 29 Mar 2022 10:48:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/neil-schipper" aria-label="Profile: neil-schipper">@<bdi>neil-schipper</bdi></a></p>
<p dir="auto">HELLO! I answer a bit too soon.</p>
<p dir="auto">I just reviewed a macro of mine that carries out a regex operation, and I learned (remembered?) that the entire regex does exist nicely in a single line in the xml file:</p>
<pre><code>            &lt;Action type="3" message="1601" wParam="0" lParam="0" sParam="\[.*?%.*? ACTIVEMIX" /&gt;

</code></pre>
<p dir="auto">so, if the only change you want to make in the macro is the regex, you could try doing this.</p>
<p dir="auto">For safety, best to quit Npp and edit the xml in another editor (like good old Win Notepad) before restarting npp.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/75565</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/75565</guid><dc:creator><![CDATA[Neil Schipper]]></dc:creator><pubDate>Tue, 29 Mar 2022 10:48:02 GMT</pubDate></item><item><title><![CDATA[Reply to Recording: How can I change the regex operations in MACRO? on Tue, 29 Mar 2022 10:41:33 GMT]]></title><description><![CDATA[<p dir="auto">@neculai-i-fantanaru:</p>
<blockquote>
<p dir="auto">to record something extra on the same macro</p>
</blockquote>
<p dir="auto">The answer is “very nearly no”, although “only with great difficulty” is more accurate.</p>
<p dir="auto">Npp does not provide a user interface for editing macros.</p>
<p dir="auto">If you look at your shortcuts.xml file you will see how the actions of a macro are stored. In theory, after a lot of research, one could modify a macro by altering records in this file. But this is rarely done.</p>
<p dir="auto">This limitation is why scripts (which are much friendlier to human eyeballs) are favored for more complex tasks or tasks where we anticipate a need for change.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/75564</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/75564</guid><dc:creator><![CDATA[Neil Schipper]]></dc:creator><pubDate>Tue, 29 Mar 2022 10:41:33 GMT</pubDate></item></channel></rss>