Macro changes my (macro) definition



  • I create a macro command:

                <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
                **<Action type="3" message="1601" wParam="0" lParam="0" sParam="&amp;#xa0;" />**
                <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
                <Action type="3" message="1602" wParam="0" lParam="0" sParam="&amp;nbsp;" />
                <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
                <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    

    When I add another command and save, Notepad++ changes the macro to:

     <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
                **<Action type="3" message="1601" wParam="0" lParam="0" sParam="&#xa0;" />**
                <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
                <Action type="3" message="1602" wParam="0" lParam="0" sParam="&amp;nbsp;" />
                <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
                <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
                <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    

    Which fails, when run, which requires me to re-edit it each time I update the shortcuts.xml.
    Any advice? Is this a bug?
    Rusty



  • @Rusty-Elston

    Notepad++ will not change your shortcuts.xml file unless, during a run, you change something which will make it need to.

    So, if you use Notepad++ to edit shortcuts.xml, then restart (to pick up your changes), your shortcuts.xml should be unchanged from your manual edits.

    If it IS changed, then you probably changed something which forced Notepad++ to write it (and you lose your manual changes). Examples of what can cause this are: recording a macro, changing a keycombo assignment, adding a Run menu entry…

    I doubt there is a bug here, but which version of Notepad++ are you running? You may want to paste your Debug Info here (shows version and some other stuff). See the ? menu > Debug Info... command.



  • Notepad++ v7.9.5 (64-bit)
    Build time : Mar 21 2021 - 02:13:17
    Path : D:\Program Files\Notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : OFF
    OS Name : Windows 10 Pro (64-bit)
    OS Version : 2009
    OS Build : 19043.1081
    Current ANSI codepage : 1252
    Plugins : Explorer.dll mimeTools.dll NppConverter.dll NppExport.dll PreviewHTML.dll XMLTools.dll

    The process is:

    Macro; Start Recording
    select the text  
    Ctrl-H (to change text)
    change it to  
    Stop Recording
    Save Current Recorded Macro
    Name it xxx (or anything)
    close NP++
    open NP++
    edit Shortcuts.xml
    macro xxx is there and NP++ has created:

    <Macro name="xxx" Ctrl="no" Alt="no" Shift="no" Key="0">
                <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
                <Action type="3" message="1601" wParam="0" lParam="0" sParam="&#xa0;" />
                <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
                <Action type="3" message="1602" wParam="0" lParam="0" sParam="&amp;nbsp;" />
                <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
                <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
            </Macro>
    

    This DOES not work if you run it…

    Change " " to “&#xa0;” and run it, it works.
    Save the change; exit NP++; start NP++ run the xxx macro and it works.
    if you do all this again and name the new macro yyy, for example, it changes both xxx and yyy to the same (non-working) code…



  • If I try recording a macro for what I think you are trying to do (but from your description it is not 100% clear to me what this is), I get the following, and it always works for me:

        <Macro name="xxx" Ctrl="no" Alt="no" Shift="no" Key="0">
            <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1601" wParam="0" lParam="0" sParam="&#x00A0;" />
            <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
            <Action type="3" message="1602" wParam="0" lParam="0" sParam="&amp;nbsp;" />
            <Action type="3" message="1702" wParam="0" lParam="512" sParam="" />
            <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
        </Macro>

Log in to reply