condition execute external, conditionexecuteexternal, kPMConditionConditionExecuteExternal — Conditional on the external executable's exit status.


condition execute external structure { invert, type, external };
invert : boolean, default, optional
type : string, choice
external : external structure


Conditional on the external executable's exit status.

execute external launches an external process and waits for the process to exit. The exit status is used as the condition's outcome.

If the process exits successfully, by returning EXIT_SUCCESS, the condition is true. If the process exits with an error, or crashes, the condition is false.

Try and avoid using condition execute external, the condition is expensive to run.

Do not rely on a condition execute external to be tested. The engine will avoid calling expensive conditions where possible. The engine may test conditions at any time. Use an action if you need to launch an external process in a predictable manner.


invert. Invert the condition's conclusion.

Conditions are designed to positively identify specific states. Many events will want a condition to confirm that a specific state is not occuring. To reverse the role of a positive condition, use the invert field.

If a condition is true, and the invert field is set, the condition will invert the true and return false.

If a condition is false, and the invert field is set, the condition will invert the false and return true.

invert is a boolean. If invert is omitted, the default false is used. invert is optional.

type. Type of condition to test.

type is a string. type must be execute external, kPMConditionType_ExecuteExternal.

external. External executable to run.

external is a external structure.