"Reveal" command for Editor

I think it would be useful to have a “Reveal” command (perhaps in the View menu) – when a item is selected in the “Macros” pane of the editor the command (or ⌘R – a common shortcut for this type of thing) would change the focus in the “Groups” pane to that macro’s enclosing group.

Yes, the group is shown in the upper right corner of the edit pane for a selected macro – this suggestion is just a additional navigational aide. Perhaps this feature already exists?

Anyone given more thought to this? I find myself wanting this capability — particularly bound to a keystroke — fairly often, the more so as the number of groups and macros in my collection increases.

Yeah, I can do that. Don’t know why I never thought of it before, because I’ve often-times wanted it.

I’ll have it ready soon, about the time Peter responds by saying there already is a way to do this, we just never knew. :slight_smile:

Yep.

See this thread:

Unfortunately the move-focus-to-group macro doesn’t handle items in the “All Macros” group neatly, but maybe Dan will discover a way around that.

-Chris

Those AS snippets just went in my toolbox. Very cool!

The way I was thinking of doing it was to determine the Group UUID of the current Macro being edited. Then I’d tell the KM Editor to edit that group, pause, then tell it to go back to editing the Macro. That should sync everything up.

Anyone see any issues with this?

Huh. Except there is no command to edit the group. I could have sworn there was.

I’ll figure it out.

Hey Dan,

That’s why I didn’t do it already.  :smile:

I don’t know how Peter is keeping track of the macro/group affiliation, because as you noted it’s not in the plist for the macro.

The only way I can see to deal with it is check all the macro nodes in every group until you get a hit, and that will be a chore.

-Chris

I get the Group UUID by calling the KME function getMacros(), which returns a plist with all groups and macros (but that’s as deep as it goes - no macro actions). So I just find the macro in the list for the macro UUID, and I know its group. (Note that for this particular plist, the “name” and “uid” keys are lower case. Really.)

Now all I have to do is figure out how to select the group in the UI list, and I’m there. I almost have it. I spent a lot of time misunderstanding some JXA error messages, but I’m past that now.

Here you go:

I have a feeling I might have missed something, 'cause I'm getting tired. Let me know if anything's wrong.

1 Like

The macro plist contains an array of groups each of which has an array of macros, or it is an array of groups, each containing an array of one macro. I’m not sure what you mean.

You can edit a macro group with AppleScript:

tell application "Keyboard Maestro"
	editMacro "Switcher Group"
end tell