Community
    • Login

    shortcuts.xml in notepad++

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 5 Posters 1.7k 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.
    • Heinz Berecz 0H
      Heinz Berecz 0
      last edited by

      I recorded the following Macro:

          <Macro name="Compare" Ctrl="no" Alt="no" Shift="no" Key="107">
              <Action type="0" message="2024" wParam="6" lParam="0" sParam="" />
              <Action type="0" message="2301" wParam="0" lParam="0" sParam="" />
              <Action type="0" message="2024" wParam="7" lParam="0" sParam="" /> . . .
      

      Now I would like to edit the Macro, but I don’t know the meaning of the lines.

      Could you please help me?

      Thank you
      Heinz Berecz

      Alan KilbornA PeterJonesP 2 Replies Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Heinz Berecz 0
        last edited by Alan Kilborn

        @Heinz-Berecz-0

        Courtesy of the macro disassembler I’m currently creating:

        <Macro name="Compare" Ctrl="no" Alt="no" Shift="no" Key="107">    VK_ADD
            <Action type="0" message="2024" wParam="6" lParam="0" sParam="" />
                SCI_GOTOLINE(6,0)
            <Action type="0" message="2301" wParam="0" lParam="0" sParam="" />
                SCI_LINEDOWNEXTEND(0,0)
            <Action type="0" message="2024" wParam="7" lParam="0" sParam="" />
                SCI_GOTOLINE(7,0)
        

        Based on the commands there, I don’t know that your macro will really do anything except move the caret to user line 8 (system line 7), certainly not a “compare” as the macro line implies.

        Heinz Berecz 0H 1 Reply Last reply Reply Quote 3
        • PeterJonesP
          PeterJones @Heinz Berecz 0
          last edited by

          @Heinz-Berecz-0 ,

          I am going to assume that you actually tried to Macro-record the Plugins > ComparePlus > Compare (or the equivalent on the older Compare Plugin). So that you know for the future, Plugin commands are not macro-recordable, because they don’t have fixed command IDs.

          If all you want is to be able to assign a keyboard shortcut to run the Compare action from a plugin, go to Settings > Shortcut Mapper > Plugin commands, and use Compare in the Filter field to find the right Compare action, then Modify the shortcut on that line.

          If you really want Compare to be part of some larger macro, you might be able to sneak your way to it: If you don’t change your list of plugins often, then Compare will be assigned the same commandID every run (until the next time you install a plugin), so you can do the steps:

          1. Install NppUISpy plugin
          2. Use that plugin to Spy!, and go into the Plugins hierarchy and see what commandID is assigned to Compare (in mine, it is 22004, but the chances are slim that yours has the same ID). Make note of that number.
          3. Whine at @Alan-Kilborn because he keeps teasing his new script without making it public Kindly remind @Alan-Kilborn that he hasn’t published his script yet, and that having access would make it so much easier for you to figure out your script without pestering him ;-)
          4. Figure out where the Compare command should go in your list of actions
          5. insert the line below, except use your number from step2 as the wParam value:
            <Action type="2" message="0" wParam="22004" lParam="0" sParam="" />
            

          After saving shortcuts.xml and restarting Notepad++, the Compare action will be part of the macro… but only until the next time you add a plugin, upgrade a plugin, or delete a plugin, at which point you will have to check to see if the ID has changed (and if it has, edit the macro again).

          Alternately, if you have the PythonScript plugin, you can write a script that calls notepad.runPluginCommand("ComparePlus", "Compare") as part of its sequence, and then follow the PythonScript manual or our PythonScript FAQ to assign a keyboard shortcut to your script. Because that avoids the volatile nature of plugin CommandID values, that would be the route I would take, if I were you.

          Of course, all this assumes that you really were trying to record the Compare action of a plugin (though I cannot think of any other Compare that you could mean, in the Notepad++ context)

          ----

          Useful Resources

          • Notepad++ User Manual: Macro Overview
          • Notepad++ User Manual: Macro Config File Details
          1 Reply Last reply Reply Quote 2
          • Heinz Berecz 0H
            Heinz Berecz 0 @Alan Kilborn
            last edited by

            @Alan-Kilborn where do I find the macro disassembler?

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

              @Heinz-Berecz-0 said in shortcuts.xml in notepad++:

              where do I find the macro disassembler?

              Currently: nowhere.
              It is still a work in progress.

              Kindly remind Alan that he hasn’t published his script yet, and that having access would make it so much easier for you to figure out your script without pestering him

              Feel free to pester; I may or may not comply by disassembling further macros.
              Like a good stew, it (the disassembler) isn’t ready until it’s ready.

              Lycan ThropeL 1 Reply Last reply Reply Quote 4
              • Lycan ThropeL
                Lycan Thrope @Alan Kilborn
                last edited by Lycan Thrope

                @Alan-Kilborn ,
                In other words, you’re trying vainly to fool-proof it.
                :-)
                Abandon all hope, ye who think a better fool can’t be made to counter your efforts.
                :-)

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

                  @Lycan-Thrope said in shortcuts.xml in notepad++:

                  you’re trying vainly to fool-proof it.

                  No, just trying to find the time, amid other projects, to finish it.

                  1 Reply Last reply Reply Quote 2
                  • TBugReporterT
                    TBugReporter
                    last edited by

                    @PeterJones said in shortcuts.xml in notepad++:

                    Whine at @Alan-Kilborn because he keeps teasing his new script without making it public Kindly remind @Alan-Kilborn that he hasn’t published his script yet

                    @Lycan-Thrope said in shortcuts.xml in notepad++:

                    In other words, you’re trying vainly to fool-proof it.

                    Could it be that there’s another person on here who’s guilty of letting the “perfect” be the enemy of the “good”? Shocking! 😯

                    @Alan-Kilborn said in shortcuts.xml in notepad++:

                    No, just trying to find the time, amid other projects, to finish it.

                    Send me a copy - I’ll finish it for you (but it’ll be 10Mb when I’m done)! 😁

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