Display Text in Window background color

I use the Dark Mode on my Mac and having the Display Text in Window with a white background is always a pain to the eyes.

I found this old post saying it was going to be "fixed" (I suppose), but with version 10 and now version 11, it's still white:

Is there a way to change this?
I remember a while ago someone pointed out that certain things such as the font can be customized, but I can't seem to find that wiki page and I don't know if this background "issue" is mentioned there.

@peternlewis any updates on this? You mentioned it would be resolved, but I'm not sure if this is what he OP was referring to or not, but I guess they were.

1 Like

The link you posted to was a comment about the background not being white, which was resolved in 9.0.1.

Text is displayed in black on white (just like Pages does for example).

I'm not sure if this will change. Maybe.

I have the same issue. It seems sometimes it can be black background as well (if I right click and then try the display text element)

image

This has been an issue for me as well. And as @berrkone9 mentioned, sometimes the KM display text windows are white text on dark background. Since I haven't really used these windows for anything beyond intermittent testing, it's been mostly tolerable. Although I'm currently working on a macro that needs to display these windows as part of its core function, so I finally set about looking for a solution.

While it would be wonderful to have more formatting/technical control over the Display Text action generally (including Display Text Large for that matter, e.g. set how long it stays visible, or have it stay visible as long as the cursor is over it, etc.), I found a simple enough workaround for my current needs, which might be helpful to others:

Use the Execute Shell Script action with the echo command and display results in a window. It means having to store the text in a variable in order to call the string in the shell, which could be more or less convenient depending on the situation, but it works.


A very creative workaround!

I'm not sure I understand this: echo will echo whatever you tell it to echo, so you can just echo text back:

$ echo "This is my text"
This is my text

You can even do multi-line stuff with a heredoc, though you'd use cat and not echo in zsh:

$ cat << EOF
heredoc> This is line 1.
heredoc> This is          line 2.
heredoc> And line three.
EOF
This is line 1.
This is          line 2.
And line three.

NOTE: The above is how it looks in Terminal.; here's a heredoc in Keyboard Maestro:

Or am I misunderstanding what you wrote?

-rob.

Oh true :sweat_smile: I think maybe I'm a little too hyperfocused on my current project that has biggish text I need to search and pull from, so I'm using variables anyway.

Since you're here, I wonder if I might run a (hopefully) quick question by you because I've hit a minor snag with this workaround already. There exists in the text string a line that contains \vpattern, and echo is treating \v as vertical tab. Incidentally, so was Prompt with List. Adding the escape \\v fixes the issue in Prompt with List, but not in the shell script. Using single rather than double quotes in the Execute Shell Script action works to make \v literal, but then using single quotes around the $KMVAR_ just makes the variable literal.

You've (at least) two things going on here -- KM processes \v as a horizontal tab, and so does sh.

You can solve the first with \\v -- that's why it worked in "Prompt with List".

You can solve the second in sh by double-escaping in KM -- \\\\v -- which could get messy! But in my tests it looks like bash is happy with the single-escaped version:

...so try explicitly calling bash.

When using bash you can also set all the relevant KM actions to "Process Nothing" and use an unescaped \v, but that'll stop all token processing in those actions so tread carefully if taking that route.

2 Likes