• Login
Community
  • Login

Can we use "Copy Bookmarked Line" and "Paste in ReplaceWith" field in Macro

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
macrosmacrosearch & replacesearch & replacesearch & replace
5 Posts 4 Posters 290 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.
  • B
    B Sethi24
    last edited by Jul 17, 2020, 6:18 PM

    Can we use “Copy Bookmarked Line” and “Paste in ReplaceWith” field in Macro

    Could anyone please advice whether in Macro, “Copy Bookmarked Line” can be used and then its value can be used by Pasting in ReplaceWith" field.

    As in recorded macro, its showing the value used at the time of recording and not having the “Copy Bookmarked Line” command and Paste in ReplaceWith filed also.

    Thanks!

    A 1 Reply Last reply Jul 17, 2020, 6:23 PM Reply Quote 0
    • A
      Alan Kilborn @B Sethi24
      last edited by Jul 17, 2020, 6:23 PM

      @B-Sethi24 said in Can we use "Copy Bookmarked Line" and "Paste in ReplaceWith" field in Macro:

      Can we use “Copy Bookmarked Line” and “Paste in ReplaceWith” field in Macro

      Nope.

      in recorded macro, its showing the value used at the time of recording

      Correct.
      For good or ill, that’s how it is designed.

      1 Reply Last reply Reply Quote 1
      • G
        guy038
        last edited by guy038 Jul 18, 2020, 10:33 AM Jul 18, 2020, 10:32 AM

        Hello, @b-sethi24, @alan-kilborn and All,

        May be, there is something that I’m missing, but, with N++ version 7.8.8, and the following XML code, inserted in the Macros node of the shortcut.xml configuration file, it works quite nice ! ?

                <Macro name="Copy BOOKMARKED lines in NEW file" Ctrl="no" Alt="no" Shift="no" Key="0">
                    <Action type="2" message="0" wParam="43019" lParam="0" sParam="" />   <!-- Copy Bookmarked Lines -->
                    <Action type="2" message="0" wParam="41001" lParam="0" sParam="" />   <!-- New                   -->
                    <Action type="0" message="2179" wParam="0" lParam="0" sParam="" />    <!-- Paste                 -->
                </Macro>
        

        Best Regards,

        guy038

        1 Reply Last reply Reply Quote 0
        • G
          guy038
          last edited by Jul 20, 2020, 11:15 AM

          Hello, @b-sethi24, @alan-kilborn and All,

          Strange ! No answer regarding my assertion / question !

          Cheers,

          guy038

          P 1 Reply Last reply Jul 20, 2020, 9:03 PM Reply Quote 0
          • P
            PeterJones @guy038
            last edited by Jul 20, 2020, 9:03 PM

            @guy038 said in Can we use "Copy Bookmarked Line" and "Paste in ReplaceWith" field in Macro:

            Hello, @b-sethi24, @alan-kilborn and All,

            Strange ! No answer regarding my assertion / question !

            Cheers,

            guy038

            I think you may have understood the original question differently than @Alan-Kilborn did. I made a similar interpretation at first, until I tried to figure out why Alan thought it wasn’t doable, when I original did. Re-reading the original post, I determined the key point was “Pasting in ReplaceWith field”.

            At first, like you, I thought @B-Sethi24 just wanted to paste the bookmarked lines in the document – in which case, the macro you showed would work.

            But if they really want to paste it into the REPLACE WITH field, with all the options available in the dialog box (including regex processing on the REPLACE WITH value), that cannot be done. (For example, if the line ${1} to ${10} were bookmarked, and they wanted to use that as the REPLACE WITH in a regex replacement.)

            Since @B-Sethi24 hasn’t come back since, I doubt we’ll get clarification anytime soon.

            1 Reply Last reply Reply Quote 3
            2 out of 5
            • First post
              2/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors