I would love the ability to select several actions in a macro and press ⌘G to put them into a “Group” action.
Yes, that would be very sweet!
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?).
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.
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)
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.
Peter, many thanks for this excellent macro.
I have modified it a bit to:
- Create the Named Clipboard ("KM Group Action") if it does not exist
- 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:
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”.
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.
Done for the next version.
* Added Engroup Actions (into a new Group, Macro, For Each, While, etc).
* Added Degroup Actions.
Thanks!