I am trying to get the clipboard output from a Python script to display the outputted text in color. I use the "Execute shell script" action and then set the output to a clipboard but there is no text formatting on the output.
I have tried python's colorama and I have also tried the python library "Rich". Both of these will print the text with color in terminal but not when run through Keyboard Maestro.
I'm not going to take time to look at those libraries, so I'm not up to speed on all of their features. Nevertheless:
As @hello mentions – you need to make sure Keyboard Maestro is properly aware of your Python environment. If you've installed a version of Python other that what comes with macOS, it's highly likely you'll need to do this.
Colored text printed to a Terminal application is NOT rich-text – it uses ANSI escape sequence sent to the terminal app to produce the colors – so it's very unlikely the libs you're using could produce rendered rich-text outside of an actual terminal app.
Good to know about the ANSI escape sequence, The "Rich" library says for "Rich text and formatting" but they probably just mean it looks like rich text and not that it actually is.
Is there any way to get python to send colored text to KM? I may just have to make the rest of the app in python, but I was trying to avoid that since I don't really know how to write python. The output from the script is just kinda hard to read without color or underlines or something like that.