Noted.
hello again @tiffle
I am a big fan of your macro and use it multiple times a day.
For many apps, I have the a macro group with all the shortcuts, a palette with one key triggers for single use and often a permanent palette also (permanently displayed) for a total of 3 macro groups.
I am using your macro only for single macro groups. Is there a way to create a get list macro which would include all macros from multiple macro groups ?
thanks very much
Hi @ronald, I'm away from my Mac so please forgive the brevity of my answer...
If I understand correctly, I would approach this in one of two ways. The first way involves AppleScript so I won't describe that one for simplicity.
The other way involves running the subroutine for each macro group and "concatenating" the result from each run prior to offering up the list to the user. So first create a list of the groups in a local variable; do this by either hardcoding the list in a set variable action or use a prompt for user input using a list of all your groups and enable the multiple selections option in the prompt action.
Then embed the call to the subroutine in a for each lines in a collection action to step through your list of groups line by line obtained from the first step. After the call to the subroutine (but within the scope of the for each loop) append the output of the subroutine to a local variable.
After the loop, you'll have the local variable containing a list of all the macros in the groups you specified in the first step, so just use that in a prompt for use input action so the user can select the macro they want to use - in the same way you do at present.
That's more or less how I'd do it.
Hope that helps you. If not let me know and I'll take a look when I'm back in the office.
Cheers!
thank you very much for taking the time to answer. Sorry to bother you ! I will try to follow your instructions and give you a follow-up.
thanks again
No bother - I like being diverted!!
See:
hello @tiffle @ComplexPoint
My efforts were in vain as you can see from my attempt at a macro below.
thank you
Bear Get List of All Macros and IDs in Common Operations - BEAR.kmmacros (11.7 KB)
I think—not positive, though—that this is at least part of the problem: You define a list of macro groups as variable Local__PromptList
, but then below, you set a new value for Local__PromptList
as you're using that as the variable in your For Each loop.
I think you want the first variable to be Local__MacrosToOpen
, as that's what you're looping through in the For Each, but I don't see that you set a value for that list before the For Each?
-rob.
So @ronald ,
I've modified your macro so it more closely resembles what I intended by my earlier post to you. Perhaps you'll have time (and inclination) to examine the macro and my description to see perhaps where you strayed a little
Download Macro(s): Bear Get List of All Macros and IDs in Common Operations - BEAR.kmmacros (11 KB)
Macro-Notes
- Macros are always disabled when imported into the Keyboard Maestro Editor.
- The user must ensure the macro is enabled.
- The user must also ensure the macro's parent macro-group is enabled.
System Information
- macOS 13.6.1
- Keyboard Maestro v11.0.3
Hopefully it works for you now.
Thanks also to @ComplexPoint and @griffman for their contributions.
The macro is fantastic. Seems to work perfectly. thank you very much. I am very grateful for your time and expertise.
I was wondering if I can simply discard the prior version of the macro. In the previous version, I had to enter the macro group in 3 actions in the macro whereas with the new version, I only have to enter one (or multiple) macro group names in the first action.
Screenshot (click to expand/collapse)
You're welcome!
Yes of course.
Hello again,
I am now confused. The macro I downloaded appears to be different from the one displayed in the disclosure. Could you perhaps have inserted the wrong macro ?
Should all 3 be set to none ?
thank you
Downloaded
Displayed
I think what's happened is because I don't have those macro groups on my system, KM has set them to whatever it has deemed appropriate i.e. "none". So I guess you need to set them to the actual values as appropriate for your system.
Apologies for missing that detail.
Sorry to pester you. I am confused again,
PLEASE NO RUSH to answer. When you are back at home and have time
In the example below, I have 3 macro groups that I want to concatenate
Bear Floating Palette
Bear Group
Bear Group Palette
What do I write for 1, 2 and 3 ?
For 1, I have no clue
For 2 and 3, do I just make 3 copies of each action (one for each macro group) of each ?
My bad - I completely forgot about what you're doing with the macro chosen from the list and the fact that the macro groups from which the list is constructed can be active or not. So if a macro is chosen from an inactive group the group has to be activated prior to running the macro and then deactivated afterwards.
Doing this was straightforward when the list involved macros from only one group - as you proved - but now we have three groups!
My thinking so far on this is that the list of macros/ids must also include the ID of the parent macro group. I can modify the subroutine to do this quite easily but it means some additional complexity once the user has chosen the macro from the list. I can't test this out right now but when I get back to the office I'll have a look - probably a day or two.
thank you very much. I am concerned that it's taking too much of your time. We could simply drop the issue or perhaps simplify it ?
Or I could perhaps create a dummy inactive macro group (in this case "Bear Fusion Group" into which I would dump all macros from 3 macro groups (Bear Floating Palette, Bear Group, Bear Group Palette), create a list containing that a single "fusion" macro group which would be activated - deactivated by the macro.
The only question that would remain is
- could I create this dummy fusion macro group with the help of a macro. (if this is not simple, I could do it by hand)
- how would I update it - perhaps empty it and recreate it.
thank you
OK, I've done some more digging and what I've found leads me to prefer your suggestion to
The main reason being that you can't use a KM variable to specify which macro group you're referring to where you have arrows here:
So you'd need to drop down into AppleScript to do that. It's not impossible but it is beyond the scope of what this thread was about originally.
My original post was to provide a subroutine to get a list of all macros in a specified group so you have the tools at your disposal in the form of your single-group macro you gave in post #14 (Subroutine to Get List of All Macros and IDs in a Specific Macro Group - #14 by ronald).
As you suggest:
and run your single-group macro on it. This should achieve very simply what you are attempting to do.
As for how you use a macro to create that group and how you update it is a question for a separate (new) thread!
I have been working with the inactive "fused" macro groups and it works perfectly.You are (obviously) right on all points. thanks a million !
I use your outstanding macro many times a day. It is superb. I was wondering if there is a way to use it with Smart Groups.
thank you
Yes there is with a small tweak to the original subroutine.
Here's an example with a smart group specified:
and the corresponding output:
So, just download the new version here:
Download Macro(s): [SUB] Get List of All Macros and IDs in Specific Group.kmmacros (6.6 KB)
Macro-Notes
- Macros are always disabled when imported into the Keyboard Maestro Editor.
- The user must ensure the macro is enabled.
- The user must also ensure the macro's parent macro-group is enabled.
System Information
- macOS 13.6.1
- Keyboard Maestro v11.0.3
It's a direct replacement for the original macro so just delete the subroutine you currently have and install this one.