It's designed to automatically change the sort option when switching between macro groups. For instance, I have several smart groups such as "created in the last week", "used in the last two minutes" etc. In those groups, I like to have the macros sorted by "creation date" and "use date" respectively. This macro detects when Keyboard Maestro's window title changes, and sorts the macros according to the group I'm currently in. The IF action ensures it only runs when the group column is clicked on. That way, when you click on a macro inside that group column (and the window's title changes again), it does not trigger and resort the macros again.
End-user modifications would include setting the string to whatever your groups is called for each "contains" switch, and then selecting the appropriate sort option in the Select Menu Item action below.
It's fairly straightforward, but if anything is unclear, or if you have suggestions as to how it can be improved, don't hesitate to reach out here or in a PM.
CURRENT VERSION: 1.3.1 (Monday, February 07, 2022)
v1.3.1: Monday, February 07, 2022
Added a condition to only trigger if the front window is the Editor.
This prevents it from triggering if you have the Macro Inspector or other such window open.
Previous release notes (click to expand/collapse)
v1.3.0: Saturday, December 25, 2021
Switched to local variables so as not to clutter up end-user's variables list.
v1.2.0: (unknown date)
I added an AppleScript to determine if the macro's title field is currently focused and if it is to abort the macro. This will prevent the macro from needlessly running when all you're doing is changing a macro's title.
While it still triggers and then runs the AppleScript, it does significantly cut down on lag while editing a title.
As always, I am sure this can be improved on, and if anybody has suggestions of a better way of doing this, please feel free to let me know.
v1.1.0: (unknown date)
Added an IF action to ensure the macro executes only when selecting a macro group.
v1.0.0: Saturday, November 27, 2021