Community
    • Login

    strange behavior with macro

    Scheduled Pinned Locked Moved General Discussion
    28 Posts 4 Posters 2.2k 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.
    • PeterJonesP
      PeterJones @Alan Kilborn
      last edited by PeterJones

      @Paul-Wormer said,

      I’ve searched in vain the context-help documents and the Npp user manual for a description of the wParam = 43061
      I did not succeed in finding a description of the search method that copies a marked string to the clipboard.

      And @Alan-Kilborn replied,

      This is because what you are seeking to find does not exist.

      It takes a little reading of the manual, and some intuition; there isn’t a nice simple name-to-description map, but the information is available. The user manual Macros section describes, in general, what the wParam is used for, and where to find details on the individual message:

      Firstly, looking in menuCmdId.h , the name of the file gives a really big hint that each of the IDM constants corresponds to a Notepad++ menu entry … but it does take some intuition.

      Secondly, it also directs you to localization\English.xml, where it says to look for those numbers. If you were to find a number like 43061 in that file, you would find one entry just labeled “Find Mark Style” in the “all menu item” <Commands> section (which would be confusing, because there are a series of entries near each other which all have that same name), but then the second instance of 43061 in the <ShortcutMapper><MainCommandNames> is the more clear “Copy Styled Text of Find Mark style”.

      However, I will add a “TODO” to try to make it more clear that the Type-2 macro entries all correspond to an entry in Notepad++'s menu system.

      Paul WormerP 1 Reply Last reply Reply Quote 0
      • Paul WormerP
        Paul Wormer @PeterJones
        last edited by Paul Wormer

        @PeterJones I don’t have localization\English.xml, but I do have C:\Users[..]\AppData\Roaming\Notepad++\nativeLang.xml in which I found:

        <Item id="43061" name="Find Mark Style"/>
        

        It takes lots of intuition and years of experience to associate this name with SEARCH_MARKEDTOCLIP.

        In any case, thank you for pointing me to this file.

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

          @Paul-Wormer said in strange behavior with macro:

          I don’t have localization\English.xml, but I do have C:\Users[…]\AppData\Roaming\Notepad++\nativeLang.xml

          Just a guess, but I’d suppose when using an installed version of Notepad++ (which I do not do), that english.xml would be under a localization folder under the folder in which the notepad++.exe file lives?

          Paul WormerP 1 Reply Last reply Reply Quote 2
          • PeterJonesP
            PeterJones @Paul Wormer
            last edited by PeterJones

            @Paul-Wormer said in strange behavior with macro:

            @PeterJones I don’t have localization\English.xml,

            Yes you do. c:\program files\notepad++\localization\english.xml, or wherever else your Notepad++ is installed – unless you didn’t install the English language localization when you did your installation (in which case, look in whichever language you do use). See Config Files Location in the manual. That’s where nativeLang,xml comes from (when you select your localization). But yes, nativeLang.xml contains the same information, so if you cannot seem to find english.xml, then use that instead.

            but I do have C:\Users[..]\AppData\Roaming\Notepad++\nativeLang.xml in which I found:

            <Item id="43061" name="Find Mark Style"/>
            

            Umm. Did you not notice I said specifically,

            you would find one entry just labeled “Find Mark Style” in the “all menu item” <Commands> section (which would be confusing, because there are a series of entries near each other which all have that same name), but then the second instance of 43061 in the <ShortcutMapper><MainCommandNames> is the more clear “Copy Styled Text of Find Mark style”.

            I rather thought I covered that confusion with that sentence.

            It takes lots of intuition and years of experience to associate this name with SEARCH_MARKEDTOCLIP.

            That’s why I told you to keep searching for the second instance, which is a more helpful name.

            And you seem to have not understood my explanation. If you know the ID already (ie, reading an existing macro), you can easily figure out which menu entry it maps to by searching for that number in the english.xml (or equivalent). On the other hand, if you want to figure out the number for a given menu entry, look at the name of the menu entry, then look for that text in the english.xml (or equivalent), and see the id it is associated with. Once you have that number, then you can figure out the number from menuCmdId.h if you really want to (but you don’t need to – because you already know which command ID which goes to the menu entry you are interested in).

            Paul WormerP 1 Reply Last reply Reply Quote 1
            • Paul WormerP
              Paul Wormer @Alan Kilborn
              last edited by

              @Alan-Kilborn Yes indeed, I have English.xml under C:\Program Files\Notepad++\localization. So, which of the two files takes precedence? Isn’t having two files a bit superfluous and therefore error prone?

              PeterJonesP Alan KilbornA 2 Replies Last reply Reply Quote 0
              • PeterJonesP
                PeterJones @Paul Wormer
                last edited by

                @Paul-Wormer ,

                So, which of the two files takes precedence? Isn’t having two files a bit superfluous and therefore error prone?

                6f1ddf8c-3062-4f46-940a-f671486e49e4-image.png

                1 Reply Last reply Reply Quote 2
                • Alan KilbornA
                  Alan Kilborn @Paul Wormer
                  last edited by

                  @Paul-Wormer said in strange behavior with macro:

                  So, which of the two files takes precedence?

                  Typically, the stuff in “appdata” is what Notepad++ is using specifically for YOU. And when a localization file is put there by the program, it calls it nativeLang.xml.

                  If you’re using English, all of the others (French, Spanish, etc.) are choices you could make in the future, so until you do, the “sources” for these are left with the main program files, with their original names.

                  1 Reply Last reply Reply Quote 2
                  • Paul WormerP
                    Paul Wormer @PeterJones
                    last edited by

                    @PeterJones Yes, I take that back. I understood perfectly well your explanation that 43061 is the key in going from Find Mark Style to IDM_SEARCH_MARKEDTOCLIP. But it takes intuition to realize that both names mean nothing more than: copy marked text to the clipboard. As Alan pointed out there is no Find involved. The Npp search popup adds to the confusion by speaking about Styled Text. I had no idea that styled text is the same as marked text, because I never looked into the text styling possibilities of N++.

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

                      @Paul-Wormer said in strange behavior with macro:

                      the key in going from “Find Mark Style” to IDM_SEARCH_MARKEDTOCLIP

                      This may be the key part of Peter’s earlier reply for you:

                      but then the second instance of 43061 in the <ShortcutMapper><MainCommandNames> is the more clear “Copy Styled Text of Find Mark style”.

                      “Find Mark Style” is the bottom-level submenu text for the command. It may not convey full meaning until you combine it with the upper part, which is what “MainCommandNames” tries to do:

                      baa740da-7b2f-4ef4-ac8a-fe84b998b90b-image.png

                      But it takes intuition to realize that both names mean nothing more than: copy marked text to the clipboard

                      I think my current answer explains it?

                      Paul WormerP 1 Reply Last reply Reply Quote 0
                      • Paul WormerP
                        Paul Wormer @Alan Kilborn
                        last edited by

                        @Alan-Kilborn said in strange behavior with macro:

                        “Copy Styled Text of Find Mark style”

                        You really feel that “Copy Styled Text of Find Mark style” is clear? Talking about intuition …

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

                          @Paul-Wormer said in strange behavior with macro:

                          You really feel that “Copy Styled Text of Find Mark style” is clear?

                          Actually, I don’t find it poor. :-)
                          YMMV.

                          It actually sounds exactly like something the Notepad++ author (a non-native English speaker) would come up with. :-)

                          1 Reply Last reply Reply Quote 1
                          • PeterJonesP
                            PeterJones @Paul Wormer
                            last edited by PeterJones

                            @Paul-Wormer ,

                            The author of the program is not a native english speaker, and some of the legacy phrasings are not always the natural english phraseology. And sometimes it is hard to convey the full meaning in a brief piece of text that’s really just meant as an indicator in the Shortcut Mapper.

                            Honestly, I would have preferred if the localization XML files had been organized in a <TopMenu menuId="search"><SubMenu menuId="Copy Styled Text"><Item id="43061" name="Find Mark Style"></SubMenu></TopMenu> format, because that would have made it easier for translators and users to find specific menu entries to translate. But at this late stage, after many years of using the existing format for the XML file, I highly doubt the developer would choose to completely redesign that config file, since it would also require changing the XML processing, and cause compatibility errors that would dwarf the confusion caused by the v7.9.1-conversion of the FunctionList definitions.

                            Macros for normal users are meant to be something that they record and run, that they never have to think about the implementation details or the syntax. And they “just work”, most of the time.

                            But if for those who want to dig into the nitty-gritty, the manual provides some guidance, but at some point, digging into the details is meant for Power Users, and Power Users are expected to have developed some intuition about the way the program works, and how to navigate through the various config files and menu systems and establish those mental mappings. And nothing but repeated readings of the manuals and tutorials that exist, navigating through the config files, and experimenting to figure things out will help you build that intuition. If you are not yet at that Power User level, that’s fine… but then you cannot expect to understand Power User details until you invest the effort. You can feel free to ask questions, and we will do our best to answer; but no answer we give nor phrasing of the user manual will ever turn you into an immediate Power User.

                            ----
                            Addendum: I do grant that one can be a Power User in one area of the application, and not in another, and some are easier to gain Power User status in than others. Macros may be one of the more complicated. You have often given great advice to other users, which I have appreciated and upvoted. However, in this instance, you may have to invest more time into exploring Macro syntax, and experimenting with going through the various steps I showed above, in order to gain Power User status on the Macros feature.

                            Paul WormerP 1 Reply Last reply Reply Quote 3
                            • Paul WormerP
                              Paul Wormer @PeterJones
                              last edited by Paul Wormer

                              @PeterJones Well, this discussion makes it perfectly clear that I am not a “Power User” . It is a status I do not necessarily strive for. But this doesn’t mean that I don’t want to understand some of the topics that are discussed on this forum. As you rightly point out, this isn’t easy, the navigation through the Scintilla and Npp docs, reading your extensive user manual, all the possible settings etc., a non-Power-User experiences it as a jungle. Just like a real jungle all this has grown over the years, and not always in a clean, logical direction, I understand that.

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

                                I opened an official issue about the original topic of this thread: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13405

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

                                  @Alan-Kilborn said in strange behavior with macro:

                                  I opened an official issue about the original topic of this thread: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13405

                                  This issue has been fixed and will appear in the next version of Notepad++, presumably that will be 8.5.2.

                                  1 Reply Last reply Reply Quote 3
                                  • pinuzzu99P
                                    pinuzzu99
                                    last edited by

                                    yes confirmed. fixed in 8.5.2 version (at point 9)

                                    https://community.notepad-plus-plus.org/topic/24345/notepad-v8-5-2-release

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