<?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 that pastes string value of clipboard to the search box, searches for results and pastes all lines of results to clipboard]]></title><description><![CDATA[<p dir="auto">Hello everyone from Greece!<br />
As I try to record my own macro, it seems that I cant find the way to make notepad++ get the CURRENT value from the clipboard in order to paste it to the search box. (It uses the string that was in the clipboard the very first time I tried the idea).<br />
Moreover, I need all lines of these results to copy and paste in the clipboard.<br />
I tried to select them by marks and simultaneous bookmarks but I cant find a way to record the action of copying these into clipboard.<br />
Any ideas? Thank you for your time!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/23043/macro-that-pastes-string-value-of-clipboard-to-the-search-box-searches-for-results-and-pastes-all-lines-of-results-to-clipboard</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 21:55:42 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/23043.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 28 May 2022 14:13:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to macro that pastes string value of clipboard to the search box, searches for results and pastes all lines of results to clipboard on Mon, 06 Jun 2022 11:27:17 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> I have just tried your work. Fantastic!!! Thank you very much for your time!!! Hope life is generous with you, as much as you are with strangers! Thank you again!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/77334</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/77334</guid><dc:creator><![CDATA[Dimitris Theocharidis]]></dc:creator><pubDate>Mon, 06 Jun 2022 11:27:17 GMT</pubDate></item><item><title><![CDATA[Reply to macro that pastes string value of clipboard to the search box, searches for results and pastes all lines of results to clipboard on Fri, 03 Jun 2022 14:49:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dimitris-theocharidis" aria-label="Profile: dimitris-theocharidis">@<bdi>dimitris-theocharidis</bdi></a> said in <a href="/post/77284">macro that pastes string value of clipboard to the search box, searches for results and pastes all lines of results to clipboard</a>:</p>
<blockquote>
<p dir="auto">I thought it was easier, something like vba in excel</p>
</blockquote>
<p dir="auto">Well… it isn’t <em>exactly</em> like that, but programming is programming is programming…</p>
<p dir="auto">As an example of how “easy” it is, I’ve coded up your request into a PythonScript that I called <code>SearchCurrDocForClipboardTextThenCopyMatchingLines.py</code> :</p>
<pre><code># -*- coding: utf-8 -*-
from __future__ import print_function

import inspect
import os

#-------------------------------------------------------------------------------

try:
    editor3h  # third editor, hidden
except NameError:
    editor3h = notepad.createScintilla()

def clipboard_get_text():
    editor3h.clearAll()
    editor3h.paste()
    retval = editor3h.getText()
    return retval

#-------------------------------------------------------------------------------

class SCDFCTTCML(object):

    def __init__(self):
        self.this_script_name = inspect.getframeinfo(inspect.currentframe()).filename.split(os.sep)[-1].rsplit('.', 1)[0]
        text_to_find = clipboard_get_text()
        if len(text_to_find) == 0 or len(text_to_find) &gt; 2046:
            self.mb('Inappropriate find-what in clipboard')
            return
        regex = r'(?-is)^.*?\Q' + text_to_find + r'\E.*'
        matches_list = []
        editor.research(regex, lambda m: matches_list.append(m.span(0)))
        line_content_list = [ editor.getTextRange(s, e) for (s, e) in matches_list ]
        editor.copyText('\r\n'.join(line_content_list))

    def mb(self, msg, flags=0, title=''):  # a message-box function
        return notepad.messageBox(msg, title if title else self.this_script_name, flags)

#-------------------------------------------------------------------------------

if __name__ == '__main__':
    SCDFCTTCML()
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/77285</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/77285</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 03 Jun 2022 14:49:13 GMT</pubDate></item><item><title><![CDATA[Reply to macro that pastes string value of clipboard to the search box, searches for results and pastes all lines of results to clipboard on Fri, 03 Jun 2022 12:46:42 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> I see - I thought it was easier, something like vba in excel. Anyhow, thank you for your reply, I will consider it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/77284</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/77284</guid><dc:creator><![CDATA[Dimitris Theocharidis]]></dc:creator><pubDate>Fri, 03 Jun 2022 12:46:42 GMT</pubDate></item><item><title><![CDATA[Reply to macro that pastes string value of clipboard to the search box, searches for results and pastes all lines of results to clipboard on Sat, 28 May 2022 15:06:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dimitris-theocharidis" aria-label="Profile: dimitris-theocharidis">@<bdi>dimitris-theocharidis</bdi></a></p>
<p dir="auto">What you’re describing I don’t think is possible with only the use of macros.  It is much more achieveable with scripting, but not sure you’d be comfortable with such a solution (requires the use of a scripting plugin and some programming – which we could help you with).  If you want to go that route, let us know.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/77099</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/77099</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 28 May 2022 15:06:09 GMT</pubDate></item></channel></rss>