How Do I Prevent KM Macro From Interfering with Alfred?

Hey gang, I have a problem and I'm not sure even how to approach a solution.

I have macros to hide some-not-all applications when they lose focus. (e.g. Messages) (I recommend this to you!)

But I also use Alfred quite a lot.

Problem: when I am in one of those "auto-hiding" applications and trigger Alfred the auto-hide macro is interrupting Alfred and the result is that the Alfred input I've triggered is lost. I have to trigger Alfred a second time if I happen to be in an "auto-hiding" application when I trigger it. (Even worse if I the app I'm in hides and the next app wants to auto-hide as well!)

Can anyone think of a way I can handle this? Thanks much for your consideration.

If you are recommending a macro you wrote, can you upload it so we can consider it?

Since I don't know what Alfred is I probably won't be able to assist, but I would like to see your macro.

Hey Sleepy. It's not really a macro worth uploading to this forum, it's a practice I find helpful.

Some of my apps I only come to infrequently. So I have an "when application X deactivates" trigger for them to hide them when I'm done with them to get them out of the way.

Unfortunately, that "deactivates" macro interrupts Alfred's focus.

BTW, if you're liking KB Maestro you really should take a loot at Alfred. Between KB Maestro, Alfred and Better Touch Tool I am rocking MacOS automation.

Can you do something along the lines of (pseudo code)?:
capture alfred hotkey
record a list of any hide macros currently running
cancel any running "hide" macros
allow user to use alfred
capture alfred session ending
restart hide macros that were running

It's kludgy, but it might spark a brainwave...

I have read reviews of BTT like this one but I can't see anything in that review that I can't already do with KM. Remap keys? I sure don't need that (the one key I want to remap, the CAPS LOCK key cannot be remapped by BTT.) Make use of the Touch Bar? I don't have a Touch Bar. Trackpad gestures? KM has that. Arranging windows? I can do that with KM if I want to, but I don't want to. What I want is a general purpose programming language. I don't see that in BTT.

As for Alfred: Clipboard histories? KM has that. Text expansion? KM has it. The features Alfred has that seem unique scare me a little bit, like going through my Contacts. Does it send my contact list back to the country where Alfred was written? I even had difficulty finding the country that Alfred's owners reside in, but I'm not concerned with the UK now that I found it over there.

Thanks both.

@Vincent: that's probably close to the right answer. I was hesitant to add logic to every single Alfred call but I don't see any alternative. (Things are complicated because I have an elaborate framework for managing windows, so I have to test if a: the app should auto-hide, and b: has the auto-hide behavior been put on "pause". Ah well, I wouldn't be in this mess if I didn't enjoy making improvements.)

@Sleepy: I'm not going to argue with you, but because you've shown an interest in automation and productivity please allow me to suggest that may not be fully aware of the capabilities of either BTT or Alfred. (for instance, the trackpad gesture support of BTT and KBM are..incomparable.) If I could only have one of the three it would be Keyboard Maestro of course. But I find use cases where each of the three can offer a superior solution.

I can't leave without pointing out one more use case that some may find helpful. BTT has much better support for selecting context menu items, and you can utilize that from a KBM macro.

Thanks again, both.

You are very likely right.

Hi @devoy, I don't use Alfred. But Launchbar 6, which is comparable to Alfred.

I had a similar problem with time-based macros running in the background. I couldn't open sub macros anymore.
I then created an app for the time-based macros using the script editor. This allowed me to work around the problem because KM can only execute one KM macro/action at a time.

Here is a video (german) about my workflow:

The SuperTab app offers a very good alternative:

There is no conflict with KM macros, as your desired hides/endings will be executed within the app.

I share your opinion and approach about working with multiple automation apps and combining them in a meaningful way.

I have always had problems with memorizing the shortcuts. A big help when using KM is BetterTouchTool.
I work a lot with the trackpad and the mouse. I also use 95% of the (conflict) palettes in KM in conjunction with sub-palettes.

I copy the KM macro AppleScript and create a gesture control in BTT. Shortcuts are a thing of the past.

In this video (german) my workflow:

If you use BTT and KM in the same way, I will include my macro for copying the KM Macro AppleScript:

UUID AS.kmmacros (5,6 KB)


Thanks for this. I'll have to dig into it more deeply when I can free some time. (Work doth rudely intrude..)