• Login
Community
  • Login

General help to built N++ macros in file "shortcuts.xml"

Scheduled Pinned Locked Moved General Discussion
3 Posts 1 Posters 412 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.
  • G
    guy038
    last edited by guy038 Jun 26, 2023, 5:58 AM Jun 26, 2023, 5:54 AM

    Hi, All,

    Recently, some people asked for help in order :

    • To build macros directly from within the shortcuts.xml file

    • To verify the contents of previous recorded macros, in the shortcuts.xml file

    • To get general information regarding the generation of macros in the shortcuts.xml file

    So, I decided to gather some documentation in an unique file, named KEY_SCI_CMD_List.txt, which could help some people !

    You can download it from https://drive.google.com/file/d/1PLhBKhEzeVJiSa99i_4LyzUGUCFJglHo/view?usp=sharing


    To make the most of this file, I recommend that you FIRST rename this file as KEY_SCI_CMD_List.cpp ( C++ file ) !

    Read the brief explanations to get the full picture and… enjoy !

    Best Regards

    guy038

    1 Reply Last reply Reply Quote 7
    • G
      guy038
      last edited by Jun 26, 2023, 8:45 PM

      Hi, All,

      BTW, at the end of my KEY_SCI_CMD_List.txt file, I said the some messages do not work anymore. I would particularly appreciate if we could show/hide the LINE NUMBER margin easily ! Because, presently, this margin is not per file handled but just globally for all files of a N++ session :-((. Generally, I don’t use the line number margin, but, in some cases, the line number margin is quite useful !

      Before N++ v7.9.2, the IDM_VIEW_LINENUMBER message ( 44012 ) worked perfectly, but adding the options Constant and Dynamic width, since the v7.9.2 version, breaks down this feature !

      Of course, I know that this should certainly be done with N++ scripts ( Python, Lua or NppExec ). However, does someone have on other idea about this problem ? ( Note that I also tried the Customize Toobar plugin, but the last v5.3 version does not propose anymore to show/hide margins, whatever they are ! )

      Hum… I’ve just realized that, speaking about plugins myself, should decide me to use a script plugin for this feature !

      BR

      guy038

      1 Reply Last reply Reply Quote 1
      • G
        guy038
        last edited by guy038 Jun 30, 2023, 8:24 AM Jun 29, 2023, 11:04 PM

        Hi, All,

        So, I tried to follow the right way with script plugins and did some tests with, either, the NppExec, Python Script and LuaScript plugins.

        However, I could not get the Line Number margin to toogle from visible to invisible status and vice-versa !

        For instance :

        • On NppExec console ( v0.84 ), the two commands :

          • npp_sendmsg WM_COMMAND IDM_VIEW_LINENUMBER

          • npp_sendmsg WM_COMMAND 44012

        do not work

        • On Python console ( v2.0.0.0 - Python 2.7.18 ), the two commands :

          • notepad.menuCommand(MENUCOMMAND.VIEW_LINENUMBER)

          • notepad.menuCommand(44012)

        do not work, as well

        • On LuaScript console ( v0.12 - Lua 5.3 ), the two commands :

          • npp:MenuCommand(IDM_VIEW_LINENUMBER)

          • npp:MenuCommand(44012)

        do not work, also

        Apparently, adding the options Constant and Dynamic width, regarding the Line Number margin, in N++ v7.9.2, breaks down this functionality, since that version :-((

        I should have realised that before ! If it was impossible to get this fucntionality with a N++ macro, this necessarily meant that NO script plugin could do any better !


        To be sure that I correctly used the scripts syntax, I did some tests with two other functions, which worked perfectly :

        • On NppExec console :

          • npp_sendmsg WM_COMMAND IDM_VIEW_REDUCETABBAR or npp_sendmsg WM_COMMAND 44005 reduce/enlarge the tabs

          • npp_sendmsg WM_COMMAND IDM_FILE_NEW or npp_sendmsg WM_COMMAND 41001 open a new file

        • On Python console :

          • notepad.menuCommand(MENUCOMMAND.VIEW_REDUCETABBAR) or notepad.menuCommand(44005) reduce/enlarge the tabs

          • notepad.menuCommand(MENUCOMMAND.FILE_NEW) or notepad.menuCommand(41001) open a new file

        • On Lua console :

          • npp:MenuCommand(IDM_VIEW_REDUCETABBAR) or npp:MenuCommand(44005) reduce/enlarge the tabs

          • npp:MenuCommand(IDM_FILE_NEW) or npp:MenuCommand(41001) open a new file


        So, how to be able to show / hide, easily, the Line Number margin ?

        May be, I need the @astrosofista’s skills as he could provide us with an AutoHotKey script to achieve this goal ?

        Best Regards,

        guy038

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