How to list current active macro groups

I use @tiffle 's excellent macro which is akin to a "search within a palette"

Subroutine to Get List of All Macros and IDs in a Specific Macro Group - Macro Library - Keyboard Maestro Discourse

My problem is that I created a variant (described in the discussion above) which is constantly activating and deactivating macro groups / palettes.

This poses a minor problem: from time to time there is a glitch and a macro group is activated by not deactivated which causes casually typing characters which serve as keyboard shortcut in that group to trigger macros. If that happens, I have to identify the problematic active macro group, and that's the task that I want to simplify.

Is there a simple way to list all current active groups.

thanks in advance for your time and help

This is a feature added in v11, in the Keyboard Maestro status menu, select Show Active Macro Groups to show the currently active groups.

3 Likes

thanks very much @peternlewis

1 Like

I hadn't noticed the addition to the status menu Peter pointed out. Super easy!

I have several macros that work with groups using applescript. For example, you can get the names of enabled macro groups like this:

tell application "Keyboard Maestro"
	set EnabledGroups to name of macro groups whose enabled is true
end tell

In case it's useful to see the actions, here's a macro that does the same thing as the status menu "Show Active Macro Groups" using applescript, but could be modified to include all groups, only include smart groups, filter groups, get the UUID instead of or in addition to name, etc.:

Get Enabled Groups by Name.kmmacros (3.9 KB)

2 Likes

Hi @evanfuchs,

Thanks for providing your macro which lists the active macro groups.

After I select the macro group, is it possible to have another prompt with list which displays all the active macros within the selected macro group?

ChrisQ

You might look at this:

1 Like

Using the same approach in the original macro, we can replicate the first three actions but use the variable saved from the first prompt, which contains the name of the selected group, and modify the applescript slightly to create a list of macros in the selected group based on that saved variable:

-- Get the variable where we stored selected group from the first prompt
set kmInst to system attribute "KMINSTANCE"
tell application "Keyboard Maestro Engine"
	set asSelectedGroup to getvariable "Local__SelectedGroup" instance kmInst
end tell

-- Get list of all macros in selected group
tell application "Keyboard Maestro"
	return name of every macro of macro group asSelectedGroup
end tell

Get Enabled Groups→Macros by Name.kmmacros (6.6 KB)

EDIT: I forgot to change the title of the second prompt to something helpful like "Choose Macro to Edit"

1 Like

Thank you so much for this. It's exactly what I was looking for. Much appreciated :slight_smile:

1 Like

Just one more question. Instead of editing the selected macro, could I run the selected macro?

That's so funny. I just revised it for exactly that:

Prompt w/ Enabled Macro Groups→Containing Macros→Edit/Run

1 Like

Fantastic! You read my mind. :slight_smile: