• Login
Community
  • Login

How to start a search automatically

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
41 Posts 7 Posters 5.9k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    dinkumoil @kaifuzi
    last edited by dinkumoil Nov 18, 2020, 9:13 AM Nov 18, 2020, 9:12 AM

    @kaifuzi

    The whole approach to remotely control Notepad++ via a VB or C# program seems to take too much effort and is not very reliable. Thus, I would like to recommend using the tool grepWin for searching (download it from >> here <<). It provides subfolder recursion, regular expression search (and replace), folder exclusion by pattern and filtering by file type, size and time stamp.

    This tool integrates itself into the Windows Explorer files and folders context menu, can also be started via command line/batch script (providing a lot of command line options) and can be configured to start Notepad++ or any other text editor by double-clicking its search results. It is even possible to place the cursor in Notepad++ at a certain search result using the appropriate Npp command line options.

    A 2 Replies Last reply Nov 19, 2020, 1:27 PM Reply Quote 1
    • A
      Alan Kilborn @kaifuzi
      last edited by Nov 18, 2020, 1:01 PM

      @kaifuzi

      One more note about your code.
      I notice that you do not set up ALL of the controls on the Find window before running your search.
      It could be dangerous (i.e. wrong results) in certain circumstances, e.g. Match case checkbox is set one way but logically the user of your code thinks it is set the other way.
      So you may want to add more code to specify the settings on other parameters that may affect your search.
      Just an FYI.

      1 Reply Last reply Reply Quote 1
      • A
        Alan Kilborn @dinkumoil
        last edited by Alan Kilborn Nov 19, 2020, 1:28 PM Nov 19, 2020, 1:27 PM

        @dinkumoil said in How to start a search automatically:

        I would like to recommend using the tool grepWin for searching

        A nice thing about this is that grepWin uses the Boost regex engine, just like Notepad++, so if you are very familiar with doing “advanced” searching with regular expressions in Notepad++, you’d feel very familiar with doing it in grepWin.

        1 Reply Last reply Reply Quote 1
        • A
          Alan Kilborn @dinkumoil
          last edited by Nov 19, 2020, 5:22 PM

          @dinkumoil said in How to start a search automatically:

          (grepWin) can be configured to start Notepad++ or any other text editor by double-clicking its search results. It is even possible to place the cursor in Notepad++ at a certain search result using the appropriate Npp command line options.

          I took a deeper look into this, and I didn’t see how to configure these two things as described. Can you elaborate, @dinkumoil ? Note that the double-clicking might be straightforward using a file association, but I don’t like those and would hope that there is another way.

          I do realize that this isn’t a grepWin support forum, but we are talking about “integration” with Notepad++, so I think it is OK.

          A 1 Reply Last reply Nov 19, 2020, 7:28 PM Reply Quote 0
          • A
            Alan Kilborn @Alan Kilborn
            last edited by Alan Kilborn Nov 19, 2020, 7:30 PM Nov 19, 2020, 7:28 PM

            @Alan-Kilborn said in How to start a search automatically:

            I took a deeper look into this, and I didn’t see how to configure these two things as described.

            @dinkumoil

            Never mind; I see it now.
            It could have been I was using an older version at first where this wasn’t supported. (Or I just missed it)
            On the latest (2.0.4) now and this configuration is available by pressing the Settings button on the grepWin UI.
            Nothing about it in the Help stuff that I saw, though.

            It can only be configured to jump to the line of the match; having a column jump would make this truly useful.

            D 1 Reply Last reply Nov 19, 2020, 8:00 PM Reply Quote 1
            • P
              pbarney @kaifuzi
              last edited by Nov 19, 2020, 7:44 PM

              @kaifuzi Another approach that might provide more flexibility is to use a third-party macro program like AutoHotKey, which is a standard for power users. You can create macros that can automate things in any program you use, including the operating system.

              Not sure if links are allowed here, but it should be pretty easy to find. There are a million different examples on the web for how to do something like this, but I think your task would be incredibly easy.

              D 1 Reply Last reply Nov 19, 2020, 8:06 PM Reply Quote 1
              • D
                dinkumoil @Alan Kilborn
                last edited by Nov 19, 2020, 8:00 PM

                @Alan-Kilborn

                Nice to hear that you were successful to configure grepWin in a way that it integrates with Notepad++.

                Indeed, I was too “enthusiastic” about grepWin in my statement above ;-). Sadly it provides no means to navigate to the column of a search result.

                1 Reply Last reply Reply Quote 1
                • D
                  dinkumoil @pbarney
                  last edited by Nov 19, 2020, 8:06 PM

                  @pbarney said in How to start a search automatically:

                  Not sure if links are allowed here

                  Yes, they are - as long as the links point to valuable content connected with the topic of the issue. You can even use the Markdown syntax for embedding links into floating text.

                  This is a [link to Npp's homepage](https://notepad-plus-plus.org/).
                  

                  becomes

                  This is a link to Npp’s homepage.

                  1 Reply Last reply Reply Quote 3
                  • A Alan Kilborn referenced this topic on Dec 18, 2021, 1:55 PM
                  • A Alan Kilborn referenced this topic on Dec 18, 2021, 1:56 PM
                  • V
                    Victorel Petrovich
                    last edited by Apr 12, 2023, 8:32 PM

                    I’m in a similar need as OP. My use case is: I have a chrome extension (“External Application Launcher” ) that can trigger any other local application to open, with arguments being several possibilities: the current html address , title, and or selection of text.
                    I would like to be able to select several words, then have that extension call Notepad++ with the reference of the current html file, AND current selection, so that Notepad can open the html file (for editing) AT THE RIGHT PLACE.

                    P 1 Reply Last reply Apr 12, 2023, 10:18 PM Reply Quote 0
                    • P
                      PeterJones @Victorel Petrovich
                      last edited by Apr 12, 2023, 10:18 PM

                      @Victorel-Petrovich ,

                      You already asked that over here – no reason to ask twice in the same Community: everyone who would see your post here will also be able to see it there. It helps no one – not even you – to post the same question in two different topics; and it annoys those of us who are most likely to help you.

                      But if the line number solution (which I suggested 15 minutes before you posted this) will not work for you, the scripting solution explored in this discussion will. If you are willing to install the PythonScript plugin, it can be made to parse the Notepad++ command line, and it could launch the search for you – even though I think forcing Notepad++ to search the file when your chrome extension should already know the exact line (-n) or character (-p) where the text starts and could pass that to notepad++'s indicated command-line arguments – so if you cannot get -n or -p to work for you, make use of the -pluginMessage option, and write a script to read that message from the PythonScript plugin, and have PS launch the search for you.

                      V 1 Reply Last reply Jul 25, 2023, 4:47 AM Reply Quote 2
                      • V
                        Victorel Petrovich @PeterJones
                        last edited by Victorel Petrovich Jul 25, 2023, 5:12 AM Jul 25, 2023, 4:47 AM

                        @PeterJones Sorry it has annoyed you or others here.

                        everyone who would see your post here will also be able to see it there.

                        How do you know that? Are people reading this page redirected automatically to the other page , or what am I missing? I thought people Choose to read a page based on it title, so the sets of readers might not (fully) overlap.

                        But if the line number solution (which I suggested 15 minutes before you posted this)

                        I guess my notifications on this site were turned off.

                        But thanks for trying to help, anyway.

                        L 1 Reply Last reply Jul 26, 2023, 1:46 AM Reply Quote 0
                        • L
                          Lycan Thrope @Victorel Petrovich
                          last edited by Jul 26, 2023, 1:46 AM

                          @Victorel-Petrovich ,
                          That’s what Search is for, in the forum’s tools. That also, is probably how @PeterJones is able to find a previous post from you, on the same subject and then link it for you to see.

                          Learn the tools available to you, so you can do things on your own, rather than keep asking others reiteratively. It’s behooves us to keep as much information contained in an already asked question so that the search won’t have you looking in several different places, because then people get tired of searching multiple threads to get the same questions answered. Understand?

                          V 1 Reply Last reply Jul 26, 2023, 2:14 AM Reply Quote -1
                          • V
                            Victorel Petrovich @Lycan Thrope
                            last edited by Jul 26, 2023, 2:14 AM

                            @Lycan-Thrope
                            You also learn to be a bit more polite.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            The Community of users of the Notepad++ text editor.
                            Powered by NodeBB | Contributors