<?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[Search&#x2F;replace macro options change, easier way?]]></title><description><![CDATA[<p dir="auto">Sometimes I create search or replace macros by recording them.  After that I sometimes need to tweak the options (match case, in-selection, and so on…).  It is hard to do this without rerecording the entire macro…by this I mean editing the macro in shortcuts.xml.  Well, editing the xml is easy, but what is hard is deciding how to change the decimal number that all the search options are encoded into.  Is there an easier way to do this and have some feeling of confidence that it has been done correctly?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/14930/search-replace-macro-options-change-easier-way</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 02:12:03 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/14930.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 16 Dec 2017 16:57:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Search&#x2F;replace macro options change, easier way? on Mon, 25 Jun 2018 18:35:58 GMT]]></title><description><![CDATA[<p dir="auto">Awesome. Thanks. Are you as lazy as the noob who just says “help”? Probably not.<br />
Good idea to put it in the <a href="http://startup.py" rel="nofollow ugc">startup.py</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/33154</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/33154</guid><dc:creator><![CDATA[hoytpr]]></dc:creator><pubDate>Mon, 25 Jun 2018 18:35:58 GMT</pubDate></item><item><title><![CDATA[Reply to Search&#x2F;replace macro options change, easier way? on Mon, 25 Jun 2018 16:07:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/8911">@hoytpr</a></p>
<blockquote>
<p dir="auto">Why am I getting…NameError: name ‘notepad’ is not defined…When I run this script?</p>
</blockquote>
<p dir="auto">Because I am lazy when testing something I post.  :-)</p>
<p dir="auto">Add this at the top of the script and I think it will fix it:</p>
<p dir="auto"><code>from Npp import notepad</code></p>
<p dir="auto">What I do is have that line (or something similar) in my <code>startup.py</code> file–that file runs when Pythonscript starts up, obviously.  This keeps me from having to put that line (and others that are similar, e.g., one for the <code>editor</code> object…) in every single Pythonscript file I have–the imports happen at startup and are available for the remainder of the Notepad++ session.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/33148</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/33148</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Mon, 25 Jun 2018 16:07:32 GMT</pubDate></item><item><title><![CDATA[Reply to Search&#x2F;replace macro options change, easier way? on Mon, 25 Jun 2018 14:48:21 GMT]]></title><description><![CDATA[<p dir="auto">Sorry, noob here.<br />
Why am  I getting:</p>
<p dir="auto">C:\Program Files\Notepad++&gt;<a href="http://1702decoder.py" rel="nofollow ugc">1702decoder.py</a><br />
Traceback (most recent call last):<br />
File “C:\Program Files\Notepad++\<a href="http://1702decoder.py" rel="nofollow ugc">1702decoder.py</a>”, line 35, in &lt;module&gt;<br />
decode1702__main()<br />
File “C:\Program Files\Notepad++\<a href="http://1702decoder.py" rel="nofollow ugc">1702decoder.py</a>”, line 19, in     decode1702__main<br />
input = notepad.prompt(‘Enter your 1702 decimal #:’, ‘’, input)<br />
NameError: name ‘notepad’ is not defined</p>
<p dir="auto">When I run this script?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/33147</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/33147</guid><dc:creator><![CDATA[hoytpr]]></dc:creator><pubDate>Mon, 25 Jun 2018 14:48:21 GMT</pubDate></item><item><title><![CDATA[Reply to Search&#x2F;replace macro options change, easier way? on Fri, 04 May 2018 20:31:28 GMT]]></title><description><![CDATA[<p dir="auto">It was discovered due to info in <a href="https://notepad-plus-plus.org/community/topic/15722/can-t-edit-the-wiki-and-i-have-a-change-to-make" rel="nofollow ugc">this thread</a> that the <strong>. matches newline</strong> checkbox was missing from the above script.  Simply inserting <code>'dot-matches-newline',</code> after the line containing <code>'downward',</code> will fix it, so it looks like this in the script:</p>
<pre><code class="language-z">'downward',
'dot-matches-newline',      # &lt;---- add me!
]
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/32062</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/32062</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Fri, 04 May 2018 20:31:28 GMT</pubDate></item><item><title><![CDATA[Reply to Search&#x2F;replace macro options change, easier way? on Tue, 19 Dec 2017 23:34:53 GMT]]></title><description><![CDATA[<p dir="auto">Nice.  I like it.  Regarding “downward”, the docs say “upward” but I think I remember reading here (maybe) that this is a bug in the docs…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28789</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28789</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 19 Dec 2017 23:34:53 GMT</pubDate></item><item><title><![CDATA[Reply to Search&#x2F;replace macro options change, easier way? on Sun, 17 Dec 2017 04:03:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a></p>
<p dir="auto">This Pythonscript may help; I call it <code>1702decoder.py</code>:</p>
<pre><code>import re

def decode1702__main():
    options_list = [
        'whole-word',
        'case-match',
        'clear-red-presearch',
        'UNUSED',
        'bookmark-line',
        'subfolders',
        'hidden',
        'in-sel',
        'wrap',
        'downward'
        ]
    input = '0'
    while True:
        input = notepad.prompt('Enter your 1702 decimal #:', '', input)
        if not input: return
        input = int(input)
        prompt_text = ''
        for (j, v) in enumerate(options_list):
            prompt_text += '[ {} ]{}      '.format('x' if input &amp; (1 &lt;&lt; j) else ' ', options_list[j])
            if (j + 1) % 3 == 0: prompt_text = prompt_text.rstrip() + '\r\n'
        prompt_text = prompt_text.rstrip()
        input = notepad.prompt('Set your desired options by putting an x inside the [   ], e.g. [ x ]:', '', prompt_text)
        if not input: return
        new_input = 0
        for (j, v) in enumerate(options_list):
            m = re.search(r'\[([^&rsqb;&rsqb;+)\]' + options_list[j], input)
            if m and m.group(1) != ' ' * len(m.group(1)): new_input |= 1 &lt;&lt; j
        input = str(new_input)

decode1702__main()
</code></pre>
<p dir="auto">When run, it produces a prompt screen where you can put a 1702 parameter value that one of your macros uses, or you can just leave it set at <code>0</code>.  Pressing OK to that prompt will decode the entered values into the corresponding option values in a second prompt screen; example for an input of <code>3</code>:</p>
<p dir="auto"><img src="https://camo.nodebb.org/ef3d9de2db1c8213fbd5d81aff49d791f9b2dd19?url=https%3A%2F%2Fi.imgur.com%2FAb5HXu8.png" alt="" class=" img-fluid img-markdown" /></p>
<p dir="auto">From this point, changing the options and pressing OK will show you the decimal number associated with those options and you can keep going, changing the value or the options and seeing the effects until you answer Cancel to a prompt.</p>
<p dir="auto">Hope this helps you.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28702</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28702</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sun, 17 Dec 2017 04:03:32 GMT</pubDate></item><item><title><![CDATA[Reply to Search&#x2F;replace macro options change, easier way? on Sat, 16 Dec 2017 17:32:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3662">@Claudia-Frank</a></p>
<p dir="auto">Hi Claudia, yes I knew about that list</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28697</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28697</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 16 Dec 2017 17:32:46 GMT</pubDate></item><item><title><![CDATA[Reply to Search&#x2F;replace macro options change, easier way? on Sat, 16 Dec 2017 17:02:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a></p>
<p dir="auto">other then hoping for completeness and relying on the list <a href="http://docs.notepad-plus-plus.org/index.php/Editing_Configuration_Files#Search_.2F_Replace_encoding" rel="nofollow ugc">here</a> - I don’t know.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28694</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28694</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Sat, 16 Dec 2017 17:02:19 GMT</pubDate></item></channel></rss>