Community
    • Login

    Macro changes my (macro) definition

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 421 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.
    • Rusty ElstonR
      Rusty Elston
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn
        last edited by Alan Kilborn

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

        1 Reply Last reply Reply Quote 0
        • Rusty ElstonR
          Rusty Elston
          last edited by Rusty Elston

          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…

          1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn
            last edited by Alan Kilborn

            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>
            
            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors