Assign a default color to an action

Is there a way of assigning a default color to a specific action? For example: the copy action whenever I use it will be green, the activate application blue and so on?
(I read in the forum about different macros for something like that, but not exactly what I'm looking for.)

1 Like

The first thing that comes to my mind is adding each action, coloured to your preference, to your favourites. I do this for say mouse-clicking actions with the restore cursor position option enabled because I very often forget to change it manually since the default action has it disabled.

3 Likes

Thanks for your reply. That's the way I've set up 2 actions. I was just wondering if there another option, like to define it somewhere in settings or so.
If there isn't I will just go on doing it that way.

2 Likes

The other way is to copy it as XML, set up how you like it, then paste the XML. There's no functional advantage for basic action insertion though; I'd stick with favourites.

1 Like

" I'd stick with favourites."
That's what I'll do.
Thx

2 Likes

I agree that the simple solution is to customize an action and add it to your Favorite actions.

I've automated the method @noisneil mentioned (using macros, of course) when I want to also pre-populate an action with some value that changes dynamically. For example, suppose you want the contents of the clipboard to automatically appear in a comment when you add it. You'll find this technique embedded in many macros throughout the forum, but since @noisneil mentioned it here, I'll direct you to one he contributed: Create Pre-Filled Action


On a related topic, I'm sure most experienced macro developers have established color conventions. For me, some colors are dedicated for action type (e.g., Comments are always magenta; Groups are almost always purple) but with other types I alternate between yellow and green (i.e., with conditional and loop actions). I do the latter because I find it easier to follow the logic when the actions are several levels deep.

Keyboard Maestro Export

The main reason I mention my color convention is that with some action types I often change the colors (i.e., I can't necessarily rely on a default color). For these actions I find it very handy to have macros with dedicated hot keys to change the action color. The set I use includes one submacro with the logic and one calling macro for each color. The calling macros are triggered (in Keyboard Maestro only) with Option+x where x is the first letter of the color, e.g., ⌥m for Magenta.

Here's the main submacro:

Keyboard Maestro Export

And here's one of the calling macros:

Keyboard Maestro Export

For those that might be interested in the complete set, here's a download link:

⋮KM Action Colors Macros.kmmacros (22.7 KB)

1 Like

My convention is dynamic. Green means "Go" ("Fully tested actions.") Yellow means "I think this works". Orange means, "I'm pretty sure there's something wrong here that needs fixing." Red means "Something is very wrong here; I need to fix this soon." So any action can get upgraded or downgraded in colour at any time.

OK, now you've given me some homework to do! :rofl:
I'll check it out.
Thanks!

1 Like

This is "too advanced" for me. I'll stick to the "personal" designated favorites because all I want is just several actions.
Thanks!

As hemicyon says above you can you use favourites.
As you can "rename" actions in favourites,there is nothing to stop you having the same action with DIFFERENT colours. e.g. comment_RED and Comment_GREEN etc.

In my own case colours are used
1: to show the extent of a group (three different colours to allow for "nesting")
2: Status of action e.g. Debug or user input
3: type e.g. comment is always GREEN

A simple set of macros to set the colour quickly can be found at
Set KM Action Colour (Color).

1 Like

Thank you for sharing this! You just answered 3 questions for me in one go.

  1. Execute submacro with paramater I really wanted to get my head wrapped around
  2. I planned on studying more things with the token trigger value which is used quite often for people.
  3. I wanted to learn more about people's ideas of colors.

I love what you have done and that gives me a whole bunch of ideas accessing menu actions and redoing how I have referenced and named things. Thanks for sharing! I will be using your macros quite often.

1 Like

Yes, I do that too. But with conditional and loop actions where I alternate the colors (as I mentioned above), the level of nesting sometimes changes as I develop the macro. Thus I find it handy to have hot keys (active only in Keyboard Maestro) to change action colors. (Nothing more fun than automating Keyboard Maestro. :nerd_face:)

And here's the scheme I've been using for quite some time now. (As with some other KM Editor macros these are some of my most frequently used macros, haha!)

The groups displays a pallet for one action when hot key control + C is pressed in the KM editor, then having single letter (or numbers 0 to 9) hot keys for choosing color. Hot key 9 or C swaps the pallet so that it displays color options with use case descriptions.

ΚΜ Set Color and Other Macros.kmmacros (58 KB)

Macro Groups Images

1 Like

Wow guys! Thanks for all the ideas you are giving me!
Since my macros/system is very simple I think I will go with the favorites option and just explore/try all other macros here just for fun/learning!

1 Like