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

    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!



  • @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.



  • 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



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

    Strange ! No answer regarding my assertion / question !

    Cheers,

    guy038



  • @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.