Feature Request: Styles for "Set Variable to Text" boxes

I've been doing a fair bit of work lately that involves building HTML+CSS pages in text variables (separated into sectiions to keep the editing somewhat sane). Then I combine all the text variables and display them in an HTML prompt window.

While this works very nicely, I would really like to be able to tell KM to display a given text box in a monospace font—looking at the not-lined-up indentations in a section of HTML bugs me :).

Mostly this is an aesthetic request, but it's also easier to find missing tags if I know that all my indentations are correct. I'm not asking for full control like you have with fonts and the ruler, etc. in the Comment and Display Text in a Window actions—just a checkbox for "Use monospace font" would be great. I should be available for any action that may be used to hold text snippets, i.e. also in the HTML Prompt action, etc.

Maybe this is already possible, but if so, I can't figure out where. (You can show the ruler on such boxes, but the results are decidedly mixed, and there's no real font control.)

I'm probably a quiet voice in the wilderness on this one, but I'd love to be able to have my code bits look like, well, code. :slight_smile:

thx;
-rob.

1 Like

Hey Rob,

You can change the font & size in a Display Text action.

Once that's done anything displayed in it will be shown in that font & size.

On your personal system you also have some styling options. Search here for “font”.

manual:Preferences [Keyboard Maestro Wiki]

-Chris

I know you can style text in Display Text boxes—I do that a ton (and even mention it in the original post above). It was the Set Variable to Text , Do Shell Script, and HTML Prompt boxes that I couldn't figure out how to modify.

But ... I did not know about the page of hidden prefs, and that's almost perfect. After experimenting a bit, changing these two helps a lot:

defaults write com.stairways.keyboardmaestro.editor Font-Shell -string "FIXED" defaults write com.stairways.keyboardmaestro.editor Font-HTML -string "FIXED"

Unfortunately, it leaves the Set Variable to Text action alone. I can change that one, too, but only if I change the entire default font to fixed:

defaults write com.stairways.keyboardmaestro.editor Font-Normal -string "FIXED"

Unfortunately, that means that everything is monospace, including (for example) new Comment actions and User Input boxes (which display correctly, they just look weird in the editor).

I can fix Comment actions via a favorite macro with a proportional font set (and have done that), but there's no way to change Input actions. I also tried some variations on the font setting commands for "Font-Variable" and "Font-Variables," but they don't seem to be defined.

For now, I'll live with the weird input boxes, as the other stuff is so much better than before—thanks!

-rob.

Don't use FIXED – use a fixed-width TrueType font like Menlo:

defaults write com.stairways.keyboardmaestro.editor Font-Normal -string "Menlo:14"

image

If you want new comment actions set up a certain way create one the way you want and make it a favorite.

I actually create one on the fly with AppleScript by manipulating the XML, insert it in the current macro, and then change the font.

-Chris

Yea, I have it set to my fave fixed-width font now; FIXED was just what I first tried based on that page.

thx;
-rob.

1 Like