Feature request: keyboard shortcut to group action in editor

I would love the ability to select several actions in a macro and press ⌘G to put them into a “Group” action.

2 Likes

Yes, that would be very sweet!

1 Like

You can almost do that now with a macro like this one. Except that Groups did not properly select their contained list when they are pasted/created (fixed for the next version, then this macro works assuming you have Named Clipboard named Group containing a Group action).

Command-G means Find Next so it can't really be subverted for this purpose.

I'll add it as a request, though it is a bit specialized (what about all the other container actions like While and For Each?).

1 Like

I would love this also. I’ve been thinking about requesting it, but didn’t think anyone else would want it. Turns out I was wrong.

1 Like

It would be useful — but especially so with Peter’s expansion to include other “parenthetical” macros — which would likely add a friction to it that makes it … less useful.

My workaround — you might be doing this already — is to use the shortcut for “Edit ▹ Insert Action ▹ By Name” (viz.: ⌃⌘a), type, for instance, “grou{return}”, and then select, drag-and-drop the Actions I want in the Group onto the empty Action Field in the Group brick. It flows well in practice (where sometimes “Do … These” is more “natural” than “These … Do”).

Of course, this workaround could be refined with Peter’s workflow design: select the Actions to be grouped, cut them to the System Clipboard, insert the Group Action, and paste them into the Group Action.

I color all “parenthetical” Actions as I find it makes the macro easier for me to follow. If “Group these” were added to the base functions of KM, I would like to see an option for setting a default color.

With 7.1.1, this macro will Engroup the selected actions.

You need to have a Named Clipboard "Group" which has the group action in it - which is good for you @Kirby_Krieger as you can then configure the color.

If I do add any sort of Engroup command natively, it would be very unlikely that I would have support for configuring the default color of the group (the only change would be yet another hidden preference).

Keyboard Maestro Actions.kmactions (2.3 KB)

2 Likes

Thanks, @peternlewis. You’re right—more factors here than I originally considered. This macro is a perfect solution for me.

Awesome! Thanks!

@peternlewis - Um, I feel stupid, but I haven’t used the clipboards much (yet). I made the named clipboard “Group” via Preferences, but how do I get the Group action into the named clipboard?

Thanks.

1 Like

Peter, many thanks for this excellent macro.

I have modified it a bit to:

  1. Create the Named Clipboard ("KM Group Action") if it does not exist
  2. Fix an issue which did not put the Group at the end of the macro when the Actions were all at the end of the macro.

See:

2 Likes

Named Clipboards are not a frequently used facility for most people (I rarely use them myself). But they are useful in cases where you need to store something other than plain text (where a variable works), and especially for storing a clipboard.

You can adjust your Named Clipboards in the Clipboards preferences in Keyboard Maestro. Create a Group action, color or label it as desired, select and Copy it, and then in the Clipboard preferences, create the Group clipboard if it is not already there, and then with it selected you can simply paste in the group - make sure you have selected the group in the left column, not whatever is displayed in the right side otherwise it will likely be pasted as text and you need to preserve the whole clipboard.

Alternatively, you can use the Named Clipboard Switcher (Command-Shift-C by default). Or you can use the Copy Clipboard to Clipboard action to copy the System Clipboard to the Named Clipboard "Group".

1 Like

Got it. Thanks for the steps - I never would have figured that out!

Peter, I was just testing this process, and I found that when I created a new Named Clipboard, it automatically pasted the current System Clipboard to the Named Clipboard.

Unexpected, but very cool.

2 Likes

Done for the next version.

* Added Engroup Actions (into a new Group, Macro, For Each, While, etc).
* Added Degroup Actions.
5 Likes

Thanks!

I was looking for a way to “very simply and in the most obvious way” GROUP a selection of Actions into a GROUP... as one can do just as naturally with other applications.

I tried the Macro attached to this thread ([KM] Put Selected Actions into Group Action.kmmacros), but it doesn't work (macOS Ventura 13.6.3).

Wouldn't there be a way to natively include in KM this command, which is so practical and effective, for example during testing or construction stages, to be able to isolate an action group and act on it? And of course, corollary to this GROUP function, the UNGROUP function would also be welcome... :smiling_face:

In the meantime, here is what I propose to group Actions together :

Hi!
This is an old topic and this feature was added natively to KM a long time ago.

Two posts up:

You can select any number of actions, right click one of them, and select Engroup ➤ Group. This is also possible through menu items Actions ➤ Engroup ➤ Group, so you can easily set up a keyboard shortcut for it also.

Personally I really like having all of the engroup options ready at my fingertips, so I've set them all up with the same keyboard shortcut resulting in a Conflict Palette, where one or two more letter presses gives me the desired engroup: ⌘⇧E+G for Group, ⌘⇧E+D for Degroup, ⌘⇧E+I+T for If Then, etc.

Like this:
KM Engroup Macros.kmmacros (25 KB)

It could probably be done even more elegantly set opp as a Macro Group Palette, but I set it up like this long enough a time ago for it now to be embedded in my muscle memory.

2 Likes

Thanks Alexander. As a result, I look like a stupid man !...
I had seen this menu but I understood it to be logical commands. Thanks again.

3 Likes

You look ignorant. Stupid people don’t ask questions, and never learn. Ignorance is a common condition given our enormous universe of knowledge and our starting condition as individuals. There is nothing shameful about ignorance. You knew you didn’t know, you attempted to solve, you suggested a solution, you asked for help where help is happily provided and you got help. Knowledge won. That’s good work in my book.

4 Likes

Thanks for sharing, I immediately downloaded these macros and incorporated them into my workflow!

1 Like