Minimizing Number of Groups (etc.)

DanThomas, (in the topic Mouse/Screen Coordinates – Simulating Click on ChatGPT Send Button):

I have 184 groups. Get used to it. :stuck_out_tongue:

I'd rather not, thanks.

For macros that are available in only specific apps, I name the group the name of the app, to make it easier to find.

I would have thought everybody does that. One thing that everybody may well not do is delete " Group" from the end of every group name, which I've done and which seems to make the panel less tediously repetitive.

Hence, my recommendation to not do this.

I was referring not to the simulated keystroke, but to use of the FrontBrowserURL token, which it turned out GPT had not proposed. Using the token works.

Anytime you try to force KM to do something it doesn't want to do, you're asking for trouble.

I'm not sure it doesn't want to do this, at least in this case and apparently in all of noisneil's.

Seriously, there's no downside to putting it in its own group. What's one more group? (Which is why I have 184 groups :roll_eyes:).

I suppose it's mostly a matter of personal taste, though with an excessive number of groups (or of a lot of things) it would seem harder to keep a handle on them.

In any event you've inspired me to a caprice, thanks. It seems that I can almost see all of my KM groups without scrolling. When I count the ones that don't immediately show, I see that if I could get rid of 17 (!) of them I could attain this result. Here's the initial list:

All Macros
Enabled Macros
___ . test macros ___ . [temp imported]
Acrobat
Activate
Affinity Photo
Affinity Publisher
Alerts
Alias Keystrokes [disabled]
Audacity
BBEdit
Brave
Brave/Opera/Chrome/Safari
Calendar
Chrome
Clicks [disabled, occasionally enabled]
Clipboard Filters
Excel
Experimental
Files/Folders
Finder
Global Macro Group [can't change name or delete]
InDesign
Keyboard Maestro
Kindle
Macro [?]
Mail
Mail – Other
Mail Messages
Messages
Messenger
Misc. Scripts
MsgFinder
Myst
On/Off [disabled but frequently enabled]
Photoshop
Placeholders
Preview
Quern
Repeat
Skype
Sound
Switch [launches/switches to programs]
System Control
System Preferences
Temp
Temp Q
Temp Stash
Terminal
Text
TextEdit
Timer
Web
WhatsApp
Wifi
Window
Window Inactive [disabled]
Word

It still seems like 17 is a tall order, but I think it may possibly be done and what the hell, I'm retired and can do anything I want so why not blow some time trying.

First of all, when I got my new Mac I couldn't use InDesign, Photoshop or Word anymore (or I could but I'd have to pay Adobe way more than I would want to, and I wouldn't want to pay Microsoft anything at all). I can't use Excel either, I notice. I never used Excel much and there's only one macro in the group: "Excel - Akademio - Fill in All J's", whatever the hell that was. Or Acrobat – Acrobat Reader yes, but I'm preferring Preview and don't presently have or need any Acrobat Reader macros.

That's five right there. Let's suppose that being neurotic I don't want to simply delete these as I would if I were a mentally normal person, but prefer to shuttle them off into five archived files or folders or whatever. Being also too lazy to find out how to do this myself, I'll ask here: How do I do this? If I select all of the macros in the Acrobat group, for example, I have the Export options Export Macros, Export as Macro Library, Export as Folder and Export All Macros as Folder. I was going to ask which of these would be preferable for the case I've described, but abashedly realized that all of these certainly are adequately explained in the user manual, which I will therefore have to read at least in part. (I read the whole thing years ago but am sure it's changed a lot since then.) [...] I don't want to export all my macros and I won't want to import them multiple times (I probably won't want to import them at all), and I want them organized, so I guess Export as Folder is what I want. I see I have a Keyboard Maestro folder alphabetically adjacent to the KM app in my Applications folder with a Macros folder already inside that, so that's where these will go in a new "Exported from MacBook Air" folder.

[...]

I was going to say that works fine, except I can't seem to get it to export to a single folder. Instead it exports to two folders – one "Acrobat" nested inside another "Acrobat", for example – and (again being neurotic) I have to move the macro files from the inner to the outer and delete the inner. If there's a way to avoid this somebody please tell me. In the meantime I think Export Macros with New Folder in the dialog will do it better? [...] But no, that puts them all in a single file, which limits my overview of what's there. So I'm doing them all with Export to Folder, grumblingly moving and deleting.

Okay, five down and twelve to go. Any comments? Particularly welcome would be a method for avoiding the double folders. If they're presently unavoidable I think this would be something that could possibly be improved in a later KM version. Thanks.

Well, you already know that I don't think what you have is an issue, so I can't help there.

I can fix your scroll problems, though. Change "Text Size" to "Small":

image

Problem solved. :grin:

Me too (retired), and that's often my philosophy too!

GIMP and LibreOffice solve some of those issues for me. (Applications, not too many groups.)

I use "Export Macros" while having a group selected and focused, making sure I either have all or none of the macros themselves selected. Then I just place that in a folder hierarchy I use for exactly this purpose.

You can test it by double-clicking the exported file to make sure you get double of everything. Then just press "Undo" to undo the import. Once I'm satisfied, I delete the group in KM.

I just read further in your comments and this probably won't help. Sorry. However a clever use of a KM macro can probably fix the double folders issue you have.

DanThomas:

Well, you already know that I don't think what you have is an issue, so I can't help there.

I'm not sure what you mean here. I currently have an issue (with how to escape from a loop; see earlier today), but it doesn't involve macro groups.

I can fix your scroll problems, though. Change "Text Size" to "Small" [...]
Problem solved. :grin:

Thanks, but that's too small for my weakening eyes.

GIMP and LibreOffice solve some of those issues [not being able to use old apps on new Mac] for me. (Applications, not too many groups.)

I've never used GIMP, though from what I hear it might do me if I could put up with a clunky interface. The Affinity suite was cheap and adequate for my skimpy retirement needs, and between Affinity Publisher, Pages, TextEdit and BBEdit, I don't need LibreOffice for documents and don't have it on my Mac anymore.

[...] a clever use of a KM macro can probably fix the double folders issue you have.

That's an interesting challenge, thanks. I'm leaving it for another day, though, as I don't want to be doing too many things at the same time. Staying on topic here, I can proceed with my attempt to trim the number of my macro groups from 58 down to 41. Five down from the other day, twelve to go.

12. Enabled Macros
Smart group provided by program. Don't use it. Deleted.

11. ___ . test macros ___ .
Two macros provided by forum members that served as basis for new macros elsewhere; exported them to new KM Forum folder in the same place as the five exported folders yesterday.

10. Activate
These came with the program, only two of them are enabled and I don't presently use those. Exported to new Activate folder in same place.

9. Affinity Photo
Consolidated with Affinity Publisher, changing name of latter to Affinity and making the group available to both programs.

8. Alerts
Two outdated and unused. Exported.

7. Alias Keystrokes
Disabled and unused. Disabled the two macros and moved to Text group.

6. Audacity
Only one macro. Exported, will reimport if ever again needed.

5. Chrome
Two macros, both disabled. Exported.

4. Mail – Other
All but one disabled, and that one didn't have a trigger. Exported.

3. Mail Messages
One outdated and unused. Exported.

2. Placeholders
Disabled copies of disabled macros in Temp Q group (now renamed to Keycode Order). Exported.

1. Sound
One Play System Beep macro. Moved to Global Macro Group.

0. Temp
All disabled except one, which I moved to Text. Exported others.

-1. Terminal
All outdated pre-retirement and disabled. Exported.

-2. Wifi
Unused. Exported.

-3. Window Inactive
Unused size/position macros from when I had two screens. Exported.

Ta-da. Yay! Now having a litle extra room, I added a new Disabled Macros group that will probably be more useful than the deleted Enabled one, facilitating further cleaning out of outdated and unused macros.

Oh, sorry then. Some of use were just now having a discussion about excessive numbers of macro groups, and I just assumed you were carrying on that discussion in another thread, which we should have been doing anyway!

So my philosophy is that I don't mind having a lot of groups as long as they're named well enough for me to find what I'm looking for.

BUT, I'm all for eliminating unused stuff, and in fact I'm working on a macro to help with that. But it sounds like you're doing just fine.

Me too, for sure! I was actually kind-of kidding.

It absolutely does have a klunky interface, and definitely takes some getting used to. It's second nature for me now, since I've used it since forever. Glad you have a solution that works for you.

I could never get used to Affinity. And I mostly only use LibreOffice for making flyers and labels.

Wish I could stick to that!

Don't forget that you can click the "All Macros" group, then change the sort to Last Used (or something like that). It can help you find rarely used macros. This is actually what the tool I'm working on will help with, along with trimming the size of macros, but I'm not sure when it'll be done.

DanThomas:

Oh, sorry then. Some of use were just now having a discussion about excessive numbers of macro groups, and I just assumed you were carrying on that discussion in another thread, which we should have been doing anyway!

Which we are, aren't we? Isn't this the other thread?

So my philosophy is that I don't mind having a lot of groups as long as they're named well enough for me to find what I'm looking for.

Diff'rent strokes for diff'rent folks.

BUT, I'm all for eliminating unused stuff, and in fact I'm working on a macro to help with that. But it sounds like you're doing just fine.

Yes. I can see all my groups without scrolling!

Me too, for sure! I was actually kind-of kidding.

But I used this option yesterday for temporarily enlarging a couple of things in macro names that were otherwise illegible, thanks.

I could never get used to Affinity.

I know what you mean. I'm one of those users who tend to say, "Why can't you make it like Photoshop?" And then they reply, "This isn't Photoshop," to the point where you stop saying it. Having to rasterize every layer before you can do anything with it is particularly annoying.

And I mostly only use LibreOffice for making flyers and labels.

This is off-topic, but what does LibreOffice have that the Mac programs and Publisher don't? Some Word stuff, I suppose. I'd think it would be fairly easy (and more esthetic UI-wise) to make a label in Pages or Publisher, but I've done very little layout since retiring so I don't know.

Don't forget that you can click the "All Macros" group, then change the sort to Last Used (or something like that). It can help you find rarely used macros. This is actually what the tool I'm working on will help with, along with trimming the size of macros, but I'm not sure when it'll be done.

Whoa, I didn't know that. I've only been thinking of the two triangle sorts you can see, Name and Trigger. But you're right, View > Sort Macros by, with additionally Date Created, Date Modified, Date Used, Size, Use Count, and Time Saved. There's also Disabled to Bottom – which enables me to delete yet another group, the Disabled smart one! I'll leave it for now, though, since I have room for it... and it too avoids scrolling.

But there's an odd problem with it that I noticed also yesterday. Namely, some of the macros listed as disabled nonetheless have the check mark and at least appear to be totally enabled. How is this, if you or anybody else who might be reading this know? There were only two with what I was doing yesterday and I wasn't using them so I clicked on the check box and disabled them too, but I don't want to do that again. Also, I just now switched the order to Name and then back to Date Used, and those enabled ones didn't display as disabled anymore. If switching the view thus clears this up if/when it happens, fine. I also notice that Disabled to Bottom applies to all the groups (not just All Macros), is persistent, and maintains the currently applied order in the disabled macros.

So, yes, more cleaning out. I'm glad I named my macros pretty systematically with Name-sortable text at front, as now I can see together in the Names sort "Lexulous - [...]" (which I don't play anymore), "Pasporta Servo - [...]" (which I don't work on anymore), etc. I've now exported and deleted the two groupings mentioned, and now I understand the utility of the double folders. Some of these exported macros were in different groups which are preserved in the subfolders. The higher-level folders have the assigned names of the folders you're archiving to, whereas the subfolders have the names of the groups they're coming from. I didn't realize this before because the names were the same. Finally, I can imagine Export as Folder being useful when you don't know which group a macro you find in a search is: you can then export it to a folder, and the name of the subfolder will tell you. I just now tried this and it works.

No need. When you've a Smart Group, or multiple Groups, selected in the Groups pane, a selected macro's Group is shown at the top of its Edit pane. This one's in "Clipboard Filters":

image

I have the system accessibility option turned on that lets me use cmd+scroll wheel to zoom the screen. I use it many times a day. I'm not ready to change my screen resolution, so this helps when I need it.

It just works more like I expect it to, coming from a Microsoft Word background.

They're probably in a group that is only enabled when specific applications are running, or something like that.

Try this macro I wrote a long time ago:

I still use it all the time. Let me know if it doesn't work for you.

Also, see this one:

If you use a lot of "Execute Macro" or "Execute Subroutine" actions, this helps find where they are.

And finally, I use this one all the time to let me jump to the handful of macros I might be working on at any time:

If it sounds like it's too much work, give it a try anyway - you'll be surprised. It's so easy to add macros to it, I find myself using it constantly. And you can hold down the command key and click a macro, and the macro will be launched instead of edited,

Top tip: Click the Group name at the top of the selected macro's Edit pane -- that'll select the "parent" Group for you.

1 Like

That sounds good, thanks. I don't have a scroll wheel, just the trackpad, but I've turned on zooming with a three-finger double-tap (without drag to toggle fixed zoom setting, with drag to do graduated zoom) and I think this may work better for me than the cmd-opt keycodes. And zooming by whatever method will be better than taking a clipboard screenshot and opening it in Affinity Photo, which is how I've been making things big enough to read lately.

They're probably in a group that is only enabled when specific applications are running, or something like that.

Or it's just some kind of glitch, if they show as disabled when you list them a second time.

Try this macro I wrote a long time ago:
[...]
I still use it all the time. Let me know if it doesn't work for you.

Unfortunately it doesn't. "## Error: Invalid index."

If you use a lot of "Execute Macro" or "Execute Subroutine" actions, this helps find where they are.

I don't remember using either of these actions (though I may have), so I don't think this would help me.

And finally, I use this one all the time to let me jump to the handful of macros I might be working on at any time:

I don't use any palettes either, and anyway the beginning of most of my macro names is the name of the group and so I don't need to check it very often – so I think I'm good with infrequently aborting a folder export, but thanks anyway.

1 Like

Yeah, that was pretty much the type of thing I had to do too.

Not likely - there's almost always an explanation. Assuming that KM has a glitch is almost always wrong.

@Nige_S posted a better solution:

FWIW I've added a macro here:

Listing: Keyboard Maestro Macro Groups grouped by their targeting pattern - Macro Library - Keyboard Maestro Discourse

for listing cases where two or more different Keyboard Maestro Macro Groups share the same pattern of targeting.

( Possibly helpful for reorganizing groups a bit – I notice that I have a couple of groups which specifically exclude two applications which are no longer installed on my system :slight_smile: )

( and my macros for the Mellel editor seem to have become inexplicably divided between two different groups )

I wasn't thinking it was or even suspecting it might be a KM glitch, just "some kind of glitch". This was as opposed to something that would presumably occur irregularly. In any event there's no problem with this now, so it doesn't matter.

@Nige_S posted a better solution:

Top tip: Click the Group name at the top of the selected macro's Edit pane -- that'll select the "parent" Group for you.

Thanks to you both. It doesn't select the group for me, but it does display it and that's all I wanted.

I'm keeping this, thanks, though my setup is simpler than yours and so I may not use it. I don't have any groups targeting the same app, or anything else listed by your macro other than 17 groups targeting all apps. What I can imagine as the likeliest use for me, then, would be to discover groups targeting all apps that should perhaps be targeting only one or a selection. I don't find any of these at present, though. I have a group named System Preferences that does things in System Preferences via AppleScript, but I want to be able to call these from anywhere.

1 Like

It selects it as in "the Group is selected in the Group pane and the macro is the active selection in the Macros pane" -- apologies for not describing the behaviour properly.

I just spend ~2h radically thinning out my macros and groups. E.g., I had a "playground" group containing hundreds of macros from the last decade or more, where the majority never has been used more than once, eg for uploading a demo to the forum. I kept some as potential snippets and deleted the other 95%.

One thing I would like to definitely know is if…

  • The amount of disabled macros has any impact
  • The amount of enabled macros in disabled groups has any impact
  • The amount of enabled macros, but without any trigger, has any impact
  • The amount of enabled macros and with triggers does have any impact (besides when they are called, of course)

With "impact', I mean one or more of these things:

  • Memory usage of the KM Engine
  • Lagginess of the KM Engine (probably the correct term is 'response time', not sure)

I thought I've stumbled across a post by Peter some time ago, mentioning these things, but I don't recall and ATM I can't find it.

So, if anyone has this post bookmarked, or knows the answer…

Otherwise, this would be a question to @peternlewis

Lagginess → reponse time → latency ?

1 Like

latency ?

Another term.

What I’m referring to is more or less what I described in the Background description of my Regularly Restart KM Engine macro. But this is not limited to using macros in games, and have them trigger an absurd amount of times per hour. I also noticed this before I used macros in games, admittedly, to a far lesser degree.

But the actual reason for my interest is rather/additionally another one:

I noticed that I sometimes get severe "lags" when dragging stuff with the mouse (text selection, window, KM action, …). In the extreme case, it feels as if the cursor with the dragged thing would be behind my mouse movement like 3 seconds. This can endure for several drag operations, or just be over after releasing the mouse and then be fine (until the next time).

I could nail approximate this down to these things: SteerMouse, Karabiner, KM Engine.

I really started noticing the issue while I was using all three.

Currently, I have Karabiner uninstalled (again, like so often in the past), but the “lag” is still there; far less often than with Karabiner. But, when I restart either SteerMouse Manager or the KM Engine, the lag goes away (completely) for some time.

So my naive thought was that – maybe – reducing the amount of present macros, even if triggerless, might have some effect on the "responsiveness" of the KME, which in turn might reduce the apparent multiplication effect in the presence of SteerMouse (and Karabiner, if loaded).

Another thing is that I cannot remember having experienced this a few months ago, so my current Sonoma version (14.5) or the recent versions before that might play a role as well…

Another factor is probably the foreground application. I notice this way more often in Adobe InDesign, for example. (But not exclusively there.)

All very vague, just trying to gather information.

PS:

Actually the only essential reason I'm using SteerMouse is the ability to associate keystrokes (eg Shift-Page-Up in InDesign) to the scroll wheel "steps" (or whatever it is called). If KM could finally incorporate this, it would be really great.

I'm aware of the discussion that took place at https://forum.keyboardmaestro.com/t/can-the-mouse-scroll-wheel-be-used-as-a-trigger, but @peternlewis , maybe worth another look?

No, it was my misunderstanding of "the selected macro's Edit pane", which I have had to refigure out. The rollover text on the Edit button is simply "Edit Mode", which does not help to know its function and is somewhat confusing. Having looked into this (or brushed up on it) in the user manual, I would suggest that the rollover text be made consistent with the related menu, namely "Start/Stop Editing" or something similar. While I'm at it, I think the rollover text "Record Mode" might be changed to "Start Recording" since this is clear and is what pressing on it does.

To make myself clear, I pressed on the Edit button thinking, because of the rollover text, that this would put me in Edit Mode and thus in the Edit pane. It put me out of edit mode, however; and when it's not in edit mode, clicking on the group name at the top of the pane (when it's visible – it isn't always) doesn't select the parent group.

Ah yes, I see what you mean. I'll confess, I'm never not in Edit mode so I hadn't noticed that!

Not on Keyboard Maestro Engine performance. Possibly on Keyboard Maestro editor performance if the size is such that writing the macro file is appreciably slower.

Same.

Same.

Almost the same.

Keyboard Maestro Engine is designed such that triggers have almost zero impact on CPU/Battery life. It is one of the limits on what can and can't be a trigger - to be a trigger there generally has to be some way to know when the trigger will happen, or some system notification when the trigger will happen so that Keyboard Maestro Engine is doing virtually nothing while waiting for the trigger.

You should be able to look at the CPU usage of the Keyboard Maestro Engine while it is idle and it should be around 1%.

Note that the Keyboard Maestro Engine is not idle if macros are running, or if the editor is asking it to do something (like evaluate conditions).

Also note that that there can be exceptions - for example, any MIDI trigger being active will enable MIDI monitoring, and some MIDI devices will send a continuous stream of lots of data and so you can get pathological cases like that.

But generally:

  • The Keyboard Maestro Engine should use no appreciable CPU while idle regardless of the number of macros or triggers you have.
  • The Keyboard Maestro editor will start to slow down when editing large macros, when the macro file is very large, or when multiple windows are open.

As far as my design philosophies related to this are:

  • The Keyboard Maestro Engine should use no appreciable CPU while idle.
  • The Keyboard Maestro editor should work well for reasonable use, and should continue working for unreasonable use, and folks on the forum are far more likely to be in the “unreasonable use” group than general Keyboard Maestro users.

So if someone comes to me and says “the Keyboard Maestro Engine is using a lot of CPU” I will help them resolve the issue, and if someone comes to me and says “the Keyboard Maestro editor is slowing down and I have 20,000 macros and my macro file is 200MB” then I will suggest that maybe they are beyond the design scope of Keyboard Maestro.

4 Likes