String Trigger

Hi

Is it possible to execute a macro after typing any three or more letters.

For example: when I write "hell or hello", the macro should be triggered. I mean after any three or more different letters.

Thank you.

yes, use "String Trigger"

1 Like

I am sorry I couldnt do it. i want execute macro after when I typed any three letters not fixed three letters. For example it should work with after any three letters like "abc, abd, acs, uhg, thr, tha, e.t.c...."

Thanks

It would be pretty ridiculous, but you could have a macro that uses three successive Pause Until actions, each of which waits for Any of the Following Are True, with 26 different key conditions in the list of Any.

Thanks

But if you were actually going to go through with that, I recommend that each Pause Until includes a nested Pause Until All of the Follow Are True, with 26 different Key is Up conditions. Otherwise, any key press will trigger as a triplet (i.e., "a" will bee seen as "aaa").

As @hello suggested, use a typed string trigger (trigger:Typed String [Keyboard Maestro Wiki]) with a regex that matches any 3 characters like this:

The wiki page is quite clear about how to use regex, so have a good look at that!

Hi, Thanks for suggestion. I found [A-Za-z]{4}\b this regex, it is working now. But it deletes previous 4 letter and get triggered. I want to trigger it after 4 letter without deleting previous four letters. I dont know is it possible?

My aim is to active F5 function key and use mac predictive text after typing 3,4 letter.

If you look closely at the trigger you'll see the solution to your question. Here it is anyway:

KM 0 2021-07-13_09-40-55

Just uncheck the box that says Simulate 14 deletes before executing.

The trigger thinks it's looking for 14 literal characters but, of course, it's a regex that only matches 4.

2 Likes

Thanks all. I can use predictive text now.

2 Likes