I would guess that those apps are just being a bit slow processing the keys (which is surprising). Because of the keyboard vent queue, there is probably nothing I can do about it short of just slowing down keystroke typing. You can do that using the Set Action Delay action.
I would suggest you simply add a very short pause at the start of your macro. 0.3 seconds was sufficient for me.
It is not that it patiently waits, it is that all the keystrokes go into the same event queue, so it really does not matter how fast or slow the application is, it will process all the events in order. The problem with the prompt is that that window appears while there are still events (delete keystrokes) in the event queue. And since Keyboard Maestro cannot see the event queue and tell when it is empty, there is no way to wait the required amount of time, it has to be done just with a fixed delay, which is not enough in this case.
When typing into BBEdit, KM’s user prompt window aborts the event queue (the one with the Delete keystrokes) if it still isn’t finished. The only remedy is to add delay, for example in form of a Pause action.
But when typing into, for example, TextMate, KM’s user prompt window does not abort that event queue. The deletion of the trigger string continues while the user prompt window is already on screen. (To make this clearly visible use a long trigger string of 50 chars or so.)
So, BBEdit’s “uniqueness” doesn’t seem to be a slow processing of the keys, but rather something different that I don’t get.
Peter, please note that this is not a usability problem for me since I usually never use KM for snippet expansion with user prompt in BBEdit. I’m just trying to understand what makes BBEdit so “outstanding”
No. Keyboard Maestro simulated 17 deletes, and then runs the macro. So the event queue has 17 deletes in it, which BBEdit is processing, it processes perhaps 6 of them in the time Keyboard Maestro Engine expects it to handle all of them. Then the macro pops up the Prompt For user Input window which steals the keyboard input focus from BBEdit. Essentially the deletes are now processed by Keyboard Maestro Engine, though probably before the dialog is actually ready for them which is why they don’t do anything.
On the other hand, if there is no prompt, then the event queue has 17 deletes followed by a bunch more text, and BBEdit processes all of them in order in due time.
With non-Barebones programs the keyboard input focus obviously does not get stolen by the user prompt. (I tested it with up to 70 chars in the trigger: deletion continues while the prompt is already on screen.)