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 526 Views 1 Watching
    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 Offline
      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

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors