Wait until the process finishes in terminal and quit terminal

According to the screenshot, the action inside the loop is not a default KM action. This is a custom action written by a user, who happens to be me (“Execute a Script in Terminal”).

It would probably be possible to close the Terminal window after successful exit (not without complications though), but it is not the purpose of this action to do this.

The action is meant for things you explicitly like (or have) to run in a visible Terminal window (instead of the “background” shell).[1] So, auto-closing the Terminal window would not be in line with the purpose of the action.

If you want to run command-line programs silently in the background, I propose to use the regular “Execute a Shell Script” KM action. (Output and/or errors will still be reported, according to the action settings.)

I hope I interpreted your issue correctly.

– Tom


1: For example for graphics-like output, or colorized output that only works in the Terminal; or table output, certain interactive processes, etc. Or for things that require a password and you don’t want to pipe it through KM/AppleScript.

2 Likes