Community
    • Login

    Macro Help Needed - Find and Mark with Style set 1-5

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    macrostyle colouringmacro writing
    1 Posts 1 Posters 410 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.
    • Bryce PetrickB
      Bryce Petrick
      last edited by

      Hey Everyone, I’m looking to tweak a macro to better suit my needs, but I can’t for the life of me figure out this Scintilla stuff (I have ZERO programming knowledge)…

      I originally tried to:
      start recording
      highlighted specific keyword 1 in document
      right click-> Style Token -> Using 1st Style
      highlighted specific keyword 2 in document
      right click-> Style Token -> Using 2nd Style
      etc

      However, after saving the macro, closing NPP and reopening, and then running that macro, it highlighted a word (not even one of my specific keywords), and nothing else, nor does the highlighting match any of the style tokens that are configured…

      Someone else built something similar to what I’m trying to do, but they are no longer available for me to reach out to for assistance, and I can’t for the life of me figure out how to tweak it (or honestly, where to even begin), … There are several of the below repeating sections (just changing the variable from “KPR|” to the next), which from my testing/understanding highlights the entire line of text:

              <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
              <Action type="3" message="1601" wParam="0" lParam="0" sParam="^(.*)(KPR\|)(.*)$" />
              <Action type="3" message="1625" wParam="0" lParam="2" sParam="" />
              <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
              <Action type="3" message="1701" wParam="0" lParam="1615" sParam="" />
      

      However there are also several of the below repeating sections (just changing the variable from “KPR|” to the next), which from my testing/understanding highlights JUST the variable that is defined:

              <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
              <Action type="3" message="1601" wParam="0" lParam="0" sParam="KPR|" />
              <Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
              <Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
              <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
              <Action type="2" message="0" wParam="43022" lParam="0" sParam="" />
      

      I don’t need to modify the “line highlighting” section, however I want to modify the “variable highlighting” section. The way it is currently configured, it seems to highlight ALL variables in the same color. I would like to further break this down by being able to highlight specific variables with different colors. Is there a way to tweak this to use the Style Tokens that are predefined in the Style Configurator (Style token 1-5)? Or is there any way to hard code it to a specific color, maybe using hex codes or RGB values?

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