How to Reduce Waiting Time in a Text-Expansion Macro

When I select this option (following a word break), it always takes a long time, almost 5 seconds, before it is triggered, I don't want to wait that long, can you adjust it?

Screen Recording 2021-11-29 at 21.32.40

ee.kmmacros (1.9 KB)

Try changing your trigger conditions to this:
KM 0 2021-11-29_13-57-57

KM is looking for a word break so if you don't supply one it might wait a long time...

Apologies if I'm not understanding your issue.

Thanks for the reply, to prevent conflicts when typing words I have selected one of the options(following a word break) below, but it always waits a long time before it can tell that I am not continuing to type the word, if this time can be controlled by myself, I can set a suitable time to trigger
I can set the trigger time in the karabiner software, I don't know if this is possible

No, you can't configure the wait time.

If you can't rely on a natural word break (like whitespace for example) then the most common way to prevent conflicts would be to use a trigger string like, for example,




so that the trigger string itself is easily distinguishable from ordinary text.

Ok , thank you for your help
I don't know if I can suggest having this option for control, I think it's still a useful feature.

Hi Jone - in your video above I can't see that you're actually typing a word break. It looks to me like you're just pausing and I don't believe that a pause in typing is generally regarded as a word break.

I've tested your macro and if I type


the macro triggers immediately which is what I would expect.

If you think you still need "control" then by all means submit a feature request but you'll obviously need to justify it to KM's developer, Peter Lewis, as something both useful and potentially would be of benefit to other users. You never know - there may already be a setting accessible from the terminal command line to adjust the delay but we just don't know about it yet :wink:

You documented your question excellently. I rarely see a question that is so well explained/documented by a user. :clap: :clap: Thank you for being so clear.

Nevertheless the example does seem quite contrived, because you are typing "heee heee heee" in an HTML document which doesn't seem like a very realistic problem that needs to be solved. So I think I understand your problem well, but I still don't see a real-world need for a new feature in KM. So can you come up with an example of a realistic problem that can't be solved with the existing KM triggers? That might be necessary to persuade the gods to make a change to KM.

No doubt, as @tiffle imagined, KM does have an internal variable which controls its timing, and perhaps that variable could be made accessible to the user. Would you want that available on a per trigger basis, or on a KM-wide basis? Which solution would make you happy? You didn't indicate what would make you happy.

I recorded a video to show what I mean, I want to be able to trigger by time, not by adding a keystroke. This is a script I made in another software karabiner, it can set the trigger time, I set the dwell time to about 1 second, when I press the "L" key twice it will switch to another program, but when I type "hello" it will not trigger, It only triggers when I pause for a second, I know this is not a 100% error free guarantee, but I can adjust it to suit my situation, so I think it is a good feature to control the trigger time by myself.

Screen Recording 2021-11-30 at 09.17.40

Yes, I agree that if there is no other way I will use this method, or change to other less conflicting keys.

Thanks for help again.

There is an actual KM trigger that will trigger based on idle time. But its minimum duration is 1 minute and you seem to be looking for a trigger of about 1 second, or a fraction of a second. (Internally, I'm not sure if the KM Engine is polling the time, or using a macOS event to trigger this. You say that karabiner allows a user to trigger on a time, but it may also be using a polling approach to implement this.)

You could always write a macro that runs in an infinite loop, perhaps with a pause very half a second, and it checks to see if the IDLE time (there is an IDLE() function) is at least a certain value, and if it is, in your case, you could send the down arrow key to the app (or take whatever action you want.) As far as I can tell, this would work 100% accurately for your situation. Is this not satisfactory for some reason?

Thanks for your help. I'll try again

I think I can explain a bit more.

There is a setting option in Karabiner to adjust, and of course to adjust for specific scripts, I just set a variable for the key that will generate a conflict, for example "e" , when I press "e" then LL won't trigger, that's all. I used KM to set it because it has a ready-made function in it and I didn't need to rewrite the script, I just didn't think about not being able to adjust the time.

Thanks for your help.

Hey Jone

It is highly unlikely that Peter will implement anything like what you describe.

I'll bet you a beer that fewer than five of his customers have asked for the feature.

Karabiner-Elements is a very specific, low-level tool that will always have features that Keyboard Maestro doesn't.


It is no matter, I think it would be better to add a slight option to the existing features so that there would be more choices.

This can be done in karabiner, but it requires rewriting the script, and I only asked this question when I found out that KM has this feature.