<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[PythonScript 3.0.24.0 - "PluginsManager:runPluginCommand Exception" dialog with "Access Violation" with one of my scripts.]]></title><description><![CDATA[<h2>Overview</h2>
<p dir="auto">Hi, I need help with the Python3 version of <code>PythonScript</code>.</p>
<p dir="auto">I’m using the latest release from here: <a href="https://github.com/bruderstein/PythonScript/releases/tag/v3.0.24" rel="nofollow ugc">https://github.com/bruderstein/PythonScript/releases/tag/v3.0.24</a></p>
<p dir="auto">My current scripts are all working fine, but I created a new script today (via Claude Opus 4.5) to transform a specific JSON format to another. Claude has never failed me until today.</p>
<p dir="auto">The script is intended to convert valid RGB values in the input, and then replace each value with the equivalent HTML Hex value.</p>
<h3>This is my script (<code>FM TransformColorJsonRgbToHex.py</code>):</h3>
<pre><code class="language-python"># -*- coding: utf-8 -*-
"""
RGB to Hex Color Converter for Notepad++ PythonScript
Converts RGB color values like "22, 22, 24" to hex format "#161618"
Handles selection or entire document with full undo support.
"""

import re

def rgb_to_hex(match):
    """
    Convert an RGB string match to hex format.
    
    Args:
        match: Regex match object containing RGB values
        
    Returns:
        Hex color string in format "#RRGGBB"
    """
    try:
        r = int(match.group(1).strip())
        g = int(match.group(2).strip())
        b = int(match.group(3).strip())
        
        # Clamp values to valid RGB range
        r = max(0, min(255, r))
        g = max(0, min(255, g))
        b = max(0, min(255, b))
        
        return '"#{:02X}{:02X}{:02X}"'.format(r, g, b)
    except (ValueError, AttributeError):
        # Return original if conversion fails
        return match.group(0)


def convert_rgb_to_hex(text):
    """
    Convert all RGB color values in text to hex format.
    
    Matches patterns like:
        "22, 22, 24"
        "255, 128, 0"
        " 22 , 22 , 24 " (with extra whitespace)
    
    Args:
        text: Input text containing RGB color values
        
    Returns:
        Text with RGB values converted to hex
    """
    # Pattern matches quoted RGB values: "R, G, B"
    # Captures three groups of digits separated by commas
    # Allows flexible whitespace
    pattern = r'"(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})"'
    
    return re.sub(pattern, rgb_to_hex, text)


def main():
    """Main entry point for the script."""
    
    # Check if there's a selection
    selection_start = editor.getSelectionStart()
    selection_end = editor.getSelectionEnd()
    has_selection = selection_start != selection_end
    
    # Begin undo action for single-step undo
    editor.beginUndoAction()
    
    try:
        if has_selection:
            # Process only selected text
            selected_text = editor.getSelText()
            converted_text = convert_rgb_to_hex(selected_text)
            
            if selected_text != converted_text:
                editor.replaceSel(converted_text)
                notepad.messageBox(
                    "RGB to Hex conversion complete (selection).",
                    "Conversion Complete",
                    0
                )
            else:
                notepad.messageBox(
                    "No RGB color values found in selection.",
                    "No Changes",
                    0
                )
        else:
            # Process entire document
            full_text = editor.getText()
            converted_text = convert_rgb_to_hex(full_text)
            
            if full_text != converted_text:
                # Preserve cursor position
                current_pos = editor.getCurrentPos()
                editor.setText(converted_text)
                
                # Restore cursor (adjust if position is now out of bounds)
                new_length = editor.getTextLength()
                editor.gotoPos(min(current_pos, new_length))
                
                notepad.messageBox(
                    "RGB to Hex conversion complete (entire document).",
                    "Conversion Complete",
                    0
                )
            else:
                notepad.messageBox(
                    "No RGB color values found in document.",
                    "No Changes",
                    0
                )
    finally:
        # Always end undo action, even if an error occurs
        editor.endUndoAction()


# Execute the script
main()
</code></pre>
<h3>This is my input (I’ve tried running on selection as well as the whole file):</h3>
<pre><code class="language-json">{
  "Name": "Some Name",
  "BackgroundColor": "22, 22, 24",
  "LightBackgroundColor": "19, 19, 21",
  "DarkBackgroundColor": "14, 14, 15",
  "TextColor": "227, 227, 239",
  "BorderColor": "39, 39, 42",
  "CheckerColor": "213, 188, 170",
  "CheckerColor2": "212, 146, 146",
  "CheckerSize": 17,
  "LinkColor": "95, 136, 255",
  "MenuHighlightColor": "44, 44, 52",
  "MenuHighlightBorderColor": "28, 28, 34",
  "MenuBorderColor": "28, 28, 34",
  "MenuCheckBackgroundColor": "186, 219, 130",
  "MenuFont": "Roboto, 14px",
  "ContextMenuFont": "Roboto, 14px",
  "ContextMenuOpacity": 100,
  "SeparatorLightColor": "255, 75, 238",
  "SeparatorDarkColor": "25, 25, 28"
}
</code></pre>
<h2>Error when Running Script</h2>
<p dir="auto">When I run the script, Notepad++ throws up an “Access Violation” dialog.</p>
<p dir="auto"><img src="https://private-user-images.githubusercontent.com/33441569/545383708-461c4e59-0ee2-420a-ae68-fc1985528d3c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzAyNzI0OTEsIm5iZiI6MTc3MDI3MjE5MSwicGF0aCI6Ii8zMzQ0MTU2OS81NDUzODM3MDgtNDYxYzRlNTktMGVlMi00MjBhLWFlNjgtZmMxOTg1NTI4ZDNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAyMDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMjA1VDA2MTYzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTljZjMyNzYyNDFlY2Y1Y2YzYmQzMWRkMGIxM2VjNTNjOGE5OWVmNjY2YzYxZDdkN2FkZmRjNDllN2EwOGQ5NmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.TrV6BJU7j5kZiWfclkOFQ7F0TbIjlVd3_y9ymXYmXsE" alt="Access Violation Error" class=" img-fluid img-markdown" /></p>
<pre><code class="language-log">PluginsManager::runPluginCommand Exception
Access Violation
</code></pre>
<h4>Other Screenshots:</h4>
<p dir="auto"> <br />
<img src="https://private-user-images.githubusercontent.com/33441569/545384383-0d6ff608-cb3a-4356-b917-dc874510d768.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzAyNzI0OTEsIm5iZiI6MTc3MDI3MjE5MSwicGF0aCI6Ii8zMzQ0MTU2OS81NDUzODQzODMtMGQ2ZmY2MDgtY2IzYS00MzU2LWI5MTctZGM4NzQ1MTBkNzY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAyMDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMjA1VDA2MTYzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgyNmFhZDhmMWU4OWY4ZDU3MDIyNGI5ZDIzYWExMTJkMTE1NjQzNGZmMjBhZjUxZmQ2MjQ2ODc4Yjk2MGY2MjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.8mFQDBsOUmDwA1j5Rph0WzyBUwv5T6MyU78MMdPKTn0" alt="Entire Window" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="https://private-user-images.githubusercontent.com/33441569/545386475-1aa3ce01-a4a3-4432-bca2-30d9e7a9e591.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzAyNzI0OTEsIm5iZiI6MTc3MDI3MjE5MSwicGF0aCI6Ii8zMzQ0MTU2OS81NDUzODY0NzUtMWFhM2NlMDEtYTRhMy00NDMyLWJjYTItMzBkOWU3YTllNTkxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAyMDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMjA1VDA2MTYzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA1NjliMTYzZmU5MTNkNjUwYmJjNzFlMWU1ZGUzYjI4OWVmMWY3OWNkZTliNDlhMjZmM2I2ZDg3MGEzNzRlZDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.MT1yMAuKS6qdZe65ml8CFkTFrypR_pqwyjEXWTyxFBc" alt="About" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="https://private-user-images.githubusercontent.com/33441569/545386637-1de450df-7729-4698-b932-7d211fd7e997.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzAyNzI0OTEsIm5iZiI6MTc3MDI3MjE5MSwicGF0aCI6Ii8zMzQ0MTU2OS81NDUzODY2MzctMWRlNDUwZGYtNzcyOS00Njk4LWI5MzItN2QyMTFmZDdlOTk3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAyMDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMjA1VDA2MTYzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU5Mjc5NjQzY2M0NGYzNzE5YzU4YTc0NjhmMGQ4NTgwZWExZDU5ZWZmNTAyMzYzMTk2M2ZiOWNhZjUxODgxYTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.3ko0RoR3gGSU-d5xxLY5-E_lgbUVD5yum6yH0yosF4w" alt="Config" class=" img-fluid img-markdown" /></p>
<p dir="auto">I have a lot of custom toolbar customization, ignore that please for now.</p>
<hr />
<h3>Ways to debug this?</h3>
<p dir="auto">This is really frustrating to diagnose because even though I have the “Show Console” enabled for PythonScript globally, it doesn’t seem to show the error in the console at all, and I have no way of knowing what line or specific section of code is throwing this error.</p>
<p dir="auto">All of my old scripts work completely fine, so I don’t think this is an installation issue. Can someone possibly spot what’s wrong with my script or at least provide me with a better way to debug this? I have no clue what to do in order to diagnose this bug.</p>
<p dir="auto">Any help would be super amazing!</p>
<p dir="auto">Thanks.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27389/pythonscript-3-0-24-0-pluginsmanager-runplugincommand-exception-dialog-with-access-violation-with-one-of-my-scripts</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Nov 2026 04:03:54 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27389.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 05 Feb 2026 05:38:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PythonScript 3.0.24.0 - "PluginsManager:runPluginCommand Exception" dialog with "Access Violation" with one of my scripts. on Thu, 05 Feb 2026 11:33:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jay-s" aria-label="Profile: Jay-S">@<bdi>Jay-S</bdi></a></p>
<p dir="auto">I replied <a href="https://github.com/bruderstein/PythonScript/issues/405" rel="nofollow ugc">here</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/104623</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/104623</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Feb 2026 11:33:03 GMT</pubDate></item></channel></rss>