<?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[Save found files?]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">I haven’t found a thread about this, so here is my question:</p>
<p dir="auto">Is there any possibility to save all files found in a find-in-files-search without having to open each one?</p>
<p dir="auto">Thanks &amp; Regards<br />
Patricia</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18524/save-found-files</link><generator>RSS for Node</generator><lastBuildDate>Wed, 13 May 2026 06:24:13 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18524.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 Nov 2019 16:05:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Save found files? on Thu, 05 Dec 2019 20:53:27 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>
<blockquote>
<p dir="auto">Not a big burden, only the “print” line for that…</p>
</blockquote>
<p dir="auto">and the encode is not needed as py2 returns bytes<br />
as well as the b before the “%p”.</p>
<blockquote>
<p dir="auto">But…What’s your magic behind f_editor?</p>
</blockquote>
<p dir="auto">Nothing, this is just my object which represents the editor in the find in files window.<br />
As you said, what you would have expected must be done on your side.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48974</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48974</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Dec 2019 20:53:27 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Thu, 05 Dec 2019 20:01:18 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 in <a href="/post/48971">Save found files?</a>:</p>
<blockquote>
<p dir="auto">I leave the changes from py3 to py2 to you</p>
</blockquote>
<p dir="auto">Not a big burden, only the “print” line for that…</p>
<p dir="auto">But…What’s your magic behind <code>f_editor</code>?  Instead of that I would have expected something like what I did in the earlier code I posted in this thread; something much messier, like:</p>
<pre><code>ctypes.WinDLL('SciLexer.dll', use_last_error=True).Scintilla_DirectFunction(self.direct_pointer, 2182, length_of_text, text_of_document)```

but using a different number than `2182` and different parameters, of course...</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/48972</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48972</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 05 Dec 2019 20:01:18 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Thu, 05 Dec 2019 18:37:45 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">Made me a bit of a headache because I assumed that the pointer was an integer data type<br />
but the npp code actually said that it was a const char pointer.<br />
In short, here’s a python script that can determine the positions of the matches.</p>
<p dir="auto">I leave the changes from py3 to py2 to you :-)</p>
<pre><code>class SearchResultMarking(ctypes.Structure):
    _fields_ = [('_start', ctypes.c_long),
                ('_end', ctypes.c_long)]


class SearchResultMarkings(ctypes.Structure):
    _fields_ = [('_length', ctypes.c_long),
                ('_markings', ctypes.POINTER(SearchResultMarking))]


# const char *addrMarkingsStruct = (styler.pprops)-&gt;Get("@MarkingsStruct");
addrMarkingsStruct = f_editor.getProperty("@MarkingsStruct").encode()

# SearchResultMarkings* pMarkings = NULL;
pMarkings = ctypes.pointer(SearchResultMarkings())

# sscanf(addrMarkingsStruct, "%p", (void**)&amp;pMarkings);
ctypes.cdll.msvcrt.sscanf(addrMarkingsStruct, b"%p", ctypes.byref(pMarkings))

for i in range(pMarkings.contents._length):
    print(f'line {i} start:{pMarkings.contents._markings[i]._start} - end:{pMarkings.contents._markings[i]._end}')
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/48971</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48971</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Dec 2019 18:37:45 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Wed, 04 Dec 2019 15:10:27 GMT]]></title><description><![CDATA[<p dir="auto">Sorry, Forgot to include the <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/92bad0a60ad606b30df9ed97aecf4ff27bb6e967/scintilla/include/Scintilla.h#L1253" rel="nofollow ugc">structure reference</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48918</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48918</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Wed, 04 Dec 2019 15:10:27 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Wed, 04 Dec 2019 14:50:29 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>
<blockquote>
<p dir="auto">Is N++ source using hardcoded magic numbers for this instead of</p>
</blockquote>
<p dir="auto">Not sure I understand the question correctly.<br />
Every lexer has hard coded style ids, which then get mapped<br />
with a color via stylers.xml. See <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/6f56b441188a114488a655c9faac9f07629da5e4/PowerEditor/src/stylers.model.xml#L1350" rel="nofollow ugc">searchResult</a>.</p>
<blockquote>
<p dir="auto">how N++ identifies the hit text</p>
</blockquote>
<p dir="auto">It uses an internal struct <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/c741f83bde6028273e72e8775e4e0854a70dbea6/scintilla/lexers/LexSearchResult.cxx#L108" rel="nofollow ugc">MarkingsStruct</a> which seems to be filled and provided<br />
as a <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/c858a2ab5db6879ea11bf53ca18a9fd7b35822ef/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp#L2289" rel="nofollow ugc">property</a> to the document. Maybe something you can use to your advantage?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48916</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48916</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Wed, 04 Dec 2019 14:50:29 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Wed, 04 Dec 2019 13:53:25 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></p>
<p dir="auto">BTW, I’m still confused after looking at N++ source on how N++ <em>identifies</em> the hit text, so that the “search result” lexer knows where it is, so if you can shed any light on that… <em>if</em> you’re sufficiently interested in doing so…  :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48911</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48911</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 04 Dec 2019 13:53:25 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Wed, 04 Dec 2019 13:42:41 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 in <a href="/post/48892">Save found files?</a>:</p>
<blockquote>
<p dir="auto">Why not using the styling information to identify the matched text?</p>
</blockquote>
<p dir="auto">Well, TBH when I earlier went searching in the N++ source code for <code>SCE_SEARCHRESULT_</code>*, I saw no occurrences of <code>SCE_SEARCHRESULT_WORD2SEARCH</code> occurring at all, so I was confused as to how it worked and was thinking it might not be possible at all to get this info via PS, even with ctypes usage.</p>
<p dir="auto">But with some experimentation with <code>SCI_GETSTYLEAT</code> it seems that I <em>can</em> recall the info; for example, in my “hit” text I get a style result of 4, which is indeed <code>SCE_SEARCHRESULT_WORD2SEARCH</code>.</p>
<p dir="auto">Is N++ source using hardcoded magic numbers for this instead of the “tags”, or some other mechanism that is strange or at least isn’t clear to me?</p>
<p dir="auto">Hmm, had a thought to search the Scintilla part of N++, where I do see <code>SCE_SEARCHRESULT_WORD2SEARCH</code> used.  That must be how it is done.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48910</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48910</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 04 Dec 2019 13:42:41 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Tue, 03 Dec 2019 22:39:29 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">Why not using the <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/92bad0a60ad606b30df9ed97aecf4ff27bb6e967/scintilla/include/SciLexer.h#L332" rel="nofollow ugc">styling information</a> to identify the matched text?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48892</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48892</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Tue, 03 Dec 2019 22:39:29 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Mon, 02 Dec 2019 19:59:34 GMT]]></title><description><![CDATA[<p dir="auto">My script code has a .getText function on the FindResultPanel object.<br />
With it I can, obviously, get the text of the Find-result window.<br />
However, I’d like to be able to get the matching text, but I don’t know how to accomplish this.<br />
Visually, I can see the hit results in the window as red text on a yellow background.<br />
Anyone know how I can pull this information?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48853</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48853</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 02 Dec 2019 19:59:34 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Thu, 21 Nov 2019 16:48:14 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>  FANTASTIC! Thank you so much, it works perfectly. My colleague and I are delighted. :))</p>
<p dir="auto">Thank you other guys as well.</p>
<p dir="auto">Awesome forum.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48604</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48604</guid><dc:creator><![CDATA[Patricia Mayer]]></dc:creator><pubDate>Thu, 21 Nov 2019 16:48:14 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Wed, 20 Nov 2019 18:40:22 GMT]]></title><description><![CDATA[<p dir="auto">I’m still a little bit confused as it seems to work most of the time like Peter described<br />
but sometimes it doesn’t, means I don’t get the filename lines copied into clipboard.<br />
Using a fresh portable 7.8.1 x64 version. Need to do further tests to see if I can find<br />
a reproducible way.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48598</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48598</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Wed, 20 Nov 2019 18:40:22 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Wed, 20 Nov 2019 14:16:38 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> said:</p>
<blockquote>
<p dir="auto">(I also confirmed that you cannot use File &gt; Copy, because that’s using the active editor window, even when Find result is the foreground pane.)</p>
</blockquote>
<p dir="auto">Presume you meant:</p>
<p dir="auto">(I also confirmed that you cannot use <strong>Edit</strong> &gt; Copy, because that’s using the active editor window, even when Find result is the foreground pane.)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48594</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48594</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 20 Nov 2019 14:16:38 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Wed, 20 Nov 2019 14:03:00 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/48585">Save found files?</a>:</p>
<blockquote>
<ul>
<li>
<p dir="auto">A <code>Ctrl + A</code> action ( or right-click on the <code>Select All</code> option ), followed with an <code>Ctrl + C</code> action and, finally, a <code>Ctrl + V</code> action, in a new tab, do copy all <strong>Find result</strong> contents. So your regex works fine, extracting the absolute pathnames of all the files involved in the search !</p>
</li>
<li>
<p dir="auto">A <code>Ctrl + A</code> action ( or right-click on the <code>Select All</code> option ), followed with a <strong>right</strong>-click on the <strong>Copy</strong> option and, finally, a <code>Ctrl + V</code> action, in a new tab, only copy the lines, containing the matched string, from all the files scanned, in the Find result window</p>
</li>
</ul>
</blockquote>
<p dir="auto">I thought I would emphasize this to <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> : <strong>the behavior is different</strong> depending on whether you use keystrokes or menu selection for the copy.  I just replicated this on portable 7.8.1-64bit.  If you use the <code>Ctrl+C</code> keystroke, it copies the filename; if you use <code>RClick &gt; Copy</code>, it only copies the lines, not the filenames.  (I also confirmed that you cannot use <strong>File &gt; Copy</strong>, because that’s using the active editor window, even when <strong>Find result</strong> is the foreground pane.)  I pasted not only into Notepad++, but into other apps as well, confirming that it’s actually the copy-operation that’s different depending on <code>Ctrl+C</code> vs <code>RClick &gt; Copy</code>.</p>
<p dir="auto">I went back to my 7.7.1-64bit, and it behaves the same way, with <code>Ctrl+C</code> vs <code>RClick &gt; Copy</code> having separate behavior.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48592</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48592</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 20 Nov 2019 14:03:00 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Wed, 20 Nov 2019 13:20:03 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 :</p>
<blockquote>
<p dir="auto">May be a plugin issue ?</p>
</blockquote>
<p dir="auto">This is a good point.  <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> can you try testing this copy/paste behavior again with a very-clean 7.8.1?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48590</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48590</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 20 Nov 2019 13:20:03 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Tue, 19 Nov 2019 21:29:26 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: ekopalypse">@<bdi>ekopalypse</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">I did a <strong>quick</strong> test and I confirm that the <strong>Alan</strong>’s behavior seems to be the <strong>default</strong> one !</p>
<p dir="auto">My <strong>configuration</strong> :</p>
<pre><code class="language-z">Notepad++ v7.8.1   (32-bit)
Build time : Oct 27 2019 - 22:46:07
Path : D:\@@\781\notepad++.exe
Admin mode : OFF
Local Conf mode : ON
OS Name : Microsoft Windows XP (32-bit) 
OS Build : 2600.0
Plugins : DSpellCheck.dll ExtSettings.dll mimeTools.dll NppConverter.dll NppExport.dll 
</code></pre>
<hr />
<ul>
<li>
<p dir="auto">A <strong><code>Ctrl + A</code></strong> action ( or <strong>right</strong>-click on the <strong><code>Select All</code></strong> option ), followed with an <strong><code>Ctrl + C</code></strong> action and, finally, a <strong><code>Ctrl + V</code></strong> action, in a <strong>new</strong> tab, do copy all <strong>Find result</strong> contents. So your regex works fine, extracting the <strong>absolute</strong> pathnames of <strong>all</strong> the files involved in the search !</p>
</li>
<li>
<p dir="auto">A <strong><code>Ctrl + A</code></strong> action ( or <strong>right</strong>-click on the <strong><code>Select All</code></strong> option ), followed with a <strong>right</strong>-click on the <strong><code>Copy</code></strong> option and, finally, a <strong><code>Ctrl + V</code></strong> action, in a <strong>new</strong> tab, <strong>only</strong> copy the lines, containing the <strong>matched</strong> string, from <strong>all</strong> the files scanned, in the <strong>Find result</strong> window</p>
</li>
</ul>
<p dir="auto">May be a <strong>plugin</strong> issue ?</p>
<p dir="auto">Best Regards</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48585</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48585</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 19 Nov 2019 21:29:26 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Tue, 19 Nov 2019 20:25:53 GMT]]></title><description><![CDATA[<p dir="auto">I probably also should add that the files copied by the script are going to be the <em>disk</em> copies of the files.  Notepad++ does an in-memory search rather than a <em>disk</em> search when it produces its hit list.  So if any of the <em>hit</em> files are dirty/modified/red-iconned when the search is conducted, the file contents that actually get copied are going to be <em>different</em> than the modified contents.</p>
<p dir="auto"><strong>TL;DR:</strong>  Save all Notepad++ files (so that none have red icons) before running the script – or when doing Eko’s originally suggested solution!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48584</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48584</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 19 Nov 2019 20:25:53 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Tue, 19 Nov 2019 20:15:52 GMT]]></title><description><![CDATA[<p dir="auto">So before this thread was started earlier today, I had some Pythonscript code for manipulating text in the Find-result window (that I never really finished or did anything with):</p>
<pre><code>import ctypes
from ctypes.wintypes import BOOL, HWND, LPARAM
import re

class FindResultPanel(object):

    def __init__(self):

        WNDENUMPROC = ctypes.WINFUNCTYPE(BOOL, HWND,LPARAM)
        FindWindow = ctypes.windll.user32.FindWindowW
        GetWindowText = ctypes.windll.user32.GetWindowTextW
        GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW
        SendMessage = ctypes.windll.user32.SendMessageW
        EnumChildWindows = ctypes.windll.user32.EnumChildWindows
        GetClassName = ctypes.windll.user32.GetClassNameW
        curr_class = ctypes.create_unicode_buffer(256)

        tag1 = 0

        find_result_panel_scintilla_handle_list = []

        def foreach_window(hwnd, lParam):
            tag2 = 1
            if lParam == tag1:
                cc = curr_class[:GetClassName(hwnd, curr_class, 256)]
                if cc == u'#32770':
                    length = GetWindowTextLength(hwnd)
                    if length &gt; 0:
                        buff = ctypes.create_unicode_buffer(length + 1)
                        GetWindowText(hwnd, buff, length + 1)
                        if buff.value == u'Find result':
                            EnumChildWindows(hwnd, WNDENUMPROC(foreach_window), tag2)
            elif lParam == tag2:
                cc = curr_class[:GetClassName(hwnd, curr_class, 256)]
                length = GetWindowTextLength(hwnd)
                if length &gt; 0:
                    buff = ctypes.create_unicode_buffer(length + 1)
                    GetWindowText(hwnd, buff, length + 1)
                    if cc == u'Scintilla':
                        find_result_panel_scintilla_handle_list.append(hwnd)
                        return False  # stop enumeration
            return True  # continue enumeration

        EnumChildWindows(FindWindow(u'Notepad++', None), WNDENUMPROC(foreach_window), tag1)

        try:
            hwnd = find_result_panel_scintilla_handle_list[-1]
        except IndexError:
            raise RuntimeError('No Find result window found')

        self.hwnd = hwnd

        # from Scintilla.iface ( https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/scintilla/include/Scintilla.iface )
        # Retrieve a pointer value to use as the first argument when calling the function returned by GetDirectFunction.
        #get int GetDirectPointer=2185(,)
        self.direct_pointer = SendMessage(self.hwnd, 2185, 0, 0)

    def GetText(self):

        # https://www.scintilla.org/ScintillaDoc.html#SCI_GETTEXT
        # Retrieve all the text in the document.
        # Returns number of characters retrieved.
        # Result is NUL-terminated.
        #fun position GetText=2182(position length, stringresult text)
        # position -&gt; intptr_t position in a document
        # stringresult -&gt; pointer to character, NULL-&gt; return size of result
        length_of_text = ctypes.WinDLL('SciLexer.dll', use_last_error=True).Scintilla_DirectFunction(self.direct_pointer, 2182, 0, 0)
        text_of_document = ctypes.c_char_p('\0' * (length_of_text + 1))  # allocate buffer to hold text
        ctypes.WinDLL('SciLexer.dll', use_last_error=True).Scintilla_DirectFunction(self.direct_pointer, 2182, length_of_text, text_of_document)
        return text_of_document.value

    def GetFoldLevel(self, line_number):

        # https://www.scintilla.org/ScintillaDoc.html#SCI_GETFOLDLEVEL
        # Retrieve the fold level of a line.
        #get FoldLevel GetFoldLevel=2223(line line,)
        SC_FOLDLEVELNUMBERMASK = 0x0FFF
        return ctypes.WinDLL('SciLexer.dll', use_last_error=True).Scintilla_DirectFunction(self.direct_pointer, 2223, line_number, 0) &amp; SC_FOLDLEVELNUMBERMASK

    def GetFoldExpanded(self, line_number):

        # https://www.scintilla.org/ScintillaDoc.html#SCI_GETFOLDEXPANDED
        # Is a header line expanded?
        #get bool GetFoldExpanded=2230(line line,)
        return ctypes.WinDLL('SciLexer.dll', use_last_error=True).Scintilla_DirectFunction(self.direct_pointer, 2230, line_number, 0)

try:

    find_result_panel = FindResultPanel()

except RuntimeError:

    notepad.messageBox('Could not find Find-result window;\r\nMaybe you have not yet run a search that would create it?', '')

else:

    find_result_text = find_result_panel.GetText()

    print_all = True if 0 else False
    copy_line_info_that_user_can_see = True if 0 else False
    copy_filepaths_that_user_can_see = True if 1 else False
    unique_filepaths_list = []

    recent_start_expanded = True
    recent_filepath_expanded = True
    for (line_number, line_contents) in enumerate(find_result_text.splitlines()):
        if print_all:
            print(line_number, find_result_panel.GetFoldLevel(line_number), find_result_panel.GetFoldExpanded(line_number), line_contents)
        else:
            if line_contents.startswith('Search'):
                recent_start_expanded = True if find_result_panel.GetFoldExpanded(line_number) else False
            elif line_contents.startswith(' '):
                recent_filepath_expanded = True if find_result_panel.GetFoldExpanded(line_number) else False
            if copy_line_info_that_user_can_see:
                if line_contents.startswith('Search'):
                    if waiting_for_start:
                        pass
            elif copy_filepaths_that_user_can_see:
                if line_contents.startswith(' '):
                    if recent_start_expanded:
                        _ = re.sub(r'^\s+(.+?) \(\d+\shits?\)$', r'\1', line_contents)
                        if _ not in unique_filepaths_list: unique_filepaths_list.append(_)

    if copy_filepaths_that_user_can_see:
        for _ in unique_filepaths_list: print(_)
</code></pre>
<p dir="auto">In this script, we see in the last line that there is something called <code>unique_filepaths_list</code>.</p>
<p dir="auto">We can put this to use for the OP’s task by adding a bit more code at the bottom:</p>
<pre><code>    keep_going = True
    while keep_going:
        destination_dir = notepad.prompt('Enter destination directory:', 'Copy files with hits', '')
        if destination_dir == None:
            keep_going = False  # cancel was pressed
        elif os.path.isdir(destination_dir): break

    if keep_going:
        from shutil import copy
        for source_file in unique_filepaths_list:
            try:
                copy(source_file, destination_dir)
            except:
                notepad.messageBox('Problem copying the file:\r\n"{}"\r\nto the folder:\r\n"{}"'.format(source_file, destination_dir), '')
</code></pre>
<p dir="auto">Running the code now (after doing a search that populates the Find-result window with the desired results) will result in the following popup prompt:</p>
<p dir="auto"><img src="/assets/uploads/files/1574194443149-902c3a28-8c7e-490c-9b8a-c09c9bd58b53-image.png" alt="902c3a28-8c7e-490c-9b8a-c09c9bd58b53-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Putting a valid folder name in the box and pressing OK will complete the desired copy operation.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48583</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48583</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 19 Nov 2019 20:15:52 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Tue, 19 Nov 2019 20:05:47 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 in <a href="/post/48581">Save found files?</a>:</p>
<blockquote>
<p dir="auto">I’m testing this on 7.8.1</p>
</blockquote>
<p dir="auto">I still use 7.8 day-to-day so my previous results were with that.  But…switching to 7.8.1 (64 bits) temporarily I do not see any change; meaning that I don’t see it working the way you do!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48582</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48582</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 19 Nov 2019 20:05:47 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Tue, 19 Nov 2019 19:48:18 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">that is strange, I only see the searched content, regardless if I select all<br />
or only partial results. The first line and every “filename line” gets stripped off.<br />
I’m testing this on 7.8.1</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48581</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48581</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Tue, 19 Nov 2019 19:48:18 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Tue, 19 Nov 2019 19:38:38 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 in <a href="/post/48579">Save found files?</a>:</p>
<blockquote>
<p dir="auto">ctrl+c does not copy the filenames, only the content found, at least for me, do you see different behavior on your side?</p>
</blockquote>
<p dir="auto">I do see different behavior; to me your result seems like a right-click copy operation in the Find-result window.</p>
<p dir="auto">Here’s some results for me (I did a ctrl+a in the Find-result window, then 3 different copy/paste ops into a new editor tab):</p>
<p dir="auto"><img src="/assets/uploads/files/1574192308261-c82ef8ee-8629-476a-b42d-41c214503ace-image.png" alt="c82ef8ee-8629-476a-b42d-41c214503ace-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/48580</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48580</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 19 Nov 2019 19:38:38 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Tue, 19 Nov 2019 18:38:18 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>
<blockquote>
<p dir="auto">Meaning select the desired result data in the Find result window, and then drag-n-drop that.</p>
</blockquote>
<p dir="auto">Yes, ctrl+c does not copy the filenames, only the content found, at least for me, do you see different behavior on your side?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48579</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48579</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Tue, 19 Nov 2019 18:38:18 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Tue, 19 Nov 2019 18:32:02 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 in <a href="/post/48577">Save found files?</a>:</p>
<blockquote>
<p dir="auto">drag and drop the result in a file with a fixed name</p>
</blockquote>
<p dir="auto">Meaning select the desired result data in the <code>Find result</code> window, and then drag-n-drop that.</p>
<blockquote>
<p dir="auto">it needs to be drag and drop</p>
</blockquote>
<p dir="auto">Why does it need to be drag-n-drop?  Wouldn’t ctrl+c be the same?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48578</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48578</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 19 Nov 2019 18:32:02 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Tue, 19 Nov 2019 17:44:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/patricia-mayer" aria-label="Profile: Patricia-Mayer">@<bdi>Patricia-Mayer</bdi></a></p>
<p dir="auto">No, there is no such feature builtin in but if this is something you need more often you could create a batch file and follow a procedure.<br />
Something like:</p>
<ul>
<li>do your search</li>
<li>drag and drop the result in a file which a fixed name (it needs to be drag and drop)</li>
<li>replace the unneeded content by using a regex like<br />
<code>find what: (?-is)(?:(?:^Search "|\tLine).*\R| \(\d+ hits?\))</code><br />
<code>replace with is empty</code><br />
press replace all (or record once a macro and run macro after drag and drop</li>
<li>run via Run menu something like:<br />
<code>cmd /k FOR /F %i IN (D:\FIXED_NAME_FILE) DO copy %i D:\temp\put_it_in_here\</code></li>
</ul>
<p dir="auto">If you replace <strong>cmd /k</strong> by <strong>cmd /c</strong> shell window gets closed automatically.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48577</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48577</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Tue, 19 Nov 2019 17:44:11 GMT</pubDate></item><item><title><![CDATA[Reply to Save found files? on Tue, 19 Nov 2019 16:58:38 GMT]]></title><description><![CDATA[<p dir="auto">I uploaded a screenshot for a better understanding:</p>
<p dir="auto"><img src="https://camo.nodebb.org/efe3c3d69c23e96e8408a9af55cefd31c70d3682?url=https%3A%2F%2Fimgur.com%2F39bF9gx.png" alt="Search results" class=" img-fluid img-markdown" /></p>
<p dir="auto">The search term was found in 228 files that are stored in several different subfolders. I would like to save all 228 files in a different location/folder.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48575</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48575</guid><dc:creator><![CDATA[Patricia Mayer]]></dc:creator><pubDate>Tue, 19 Nov 2019 16:58:38 GMT</pubDate></item></channel></rss>