Script condition: "returns no text"

Hi,
With Keyboard Maestro 8, I'm trying to use the script condition "returns no text" ( mentioned here: https://wiki.keyboardmaestro.com/condition/Script ) to activate a macro only if the result of a shell script contains nothing.

It's a simple grep search.

I want to launch another macro only if the grep search gives no result. But I don't see the "returns no text" option in the menu:

Any suggestion?
(Any other way of doing the same thing would be welcome.)

Hi @HigashiFukai,

I believe the "is empty" option is the "returns no text" option that you're looking for. However, I can also tell you that quoting a KM variable in a shell script like that won't work; it has to be written like $KMVAR_[variable_name] as described here, https://wiki.keyboardmaestro.com/action/Execute_a_Shell_Script#Using_Keyboard_Maestro_Variables

And yes, there is definitely another way of doing the same thing. This one may even be easier, since it uses native KM variable syntax:

Regex Search File.kmmacros (2.9 KB)

1 Like

Thank you very much gglick :slight_smile:

1 Like