How can I use other KM macros inside User prompt?

I have this macro:

Manipulate clipboard.kmmacros (26.9 KB)

The macro lets me make changes to my current clipboard and save them.

However when I tried to run my macros on the text inside the prompt. For example my macro to uppercase selected text:

Nothing happens. The macros don't get to run inside this prompt. They enter into a queue I assume and will only run after I complete the prompt. Is there a way I can use my KM text manipulation macros inside this Prompt?

How are you triggering these text manipulation macros?

You cannot use a typed-string trigger in a KM Prompt for User. But hotkey triggers should work just fine.

I am triggering the macros with Applescript like this:

tell application "Keyboard Maestro Engine"
do script "Uppercase selected text"
end tell

I tested and it does work if I trigger the macro from a hotkey. But it does not work if I trigger it from Applescript like above. Is this a bug?

How are you executing the AppleScripts while inside a prompt? A macro containing the AppleScript? Alfred? Something else? If it’s a macro, how are you triggering that?

I am executing the AppleScripts from Karabiner. It calls the Applescript code I sent above which is the macro that does the text manipulation.

Hmm. Unfortunately I don’t know what to tell you then, since while I have Karabiner Elements I can’t even install Karabiner on High Sierra, so I can’t test how it runs AppleScripts. I can tell you that running that kind of script from inside Script Debugger on a text selection inside a KM prompt triggers the corresponding macro without a problem for me, so whatever is going on, I don’t believe it’s a bug.

You should try to find out if the problem is on Karabiner’s side or on KM’s side.

Use this little debug script for that:

say "Hello, script is running."

First, run it in Script Editor, just to make sure your sound output is working.

If you hear the words spoken when run in Script Editor, then launch the script via Karabiner (in place of your above script and under the same conditions).

If you still hear the words spoken, then I would say that Karabiner has launched the script correctly. If not, then you know that something is wrong with Karabiner’s script launching.