This is what Bash while loops do:
It will run the application, and if it terminates successfully run the body of the loop.
: is the shell's no-op command (the loop has to have a body, so that's what we put there); after that it goes back to the top and runs the program again. If it fails, the loop stops running and the script exits.
However, it looks like what you're running might be an ordinary Mac application (
.app): there are a couple of issues that come up in that case. One is that you need to use the
open command, rather than running the application directory directly:
The other is that when you do
open will usually terminate immediately with a success, regardless of what the application goes on to do: that isn't absolutely universal, but most will. If your one does, you can use the
-W option to force
open to block until the application ends:
open -W /path/to/application.app. Note that if the application was already running, this will wait until the existing execution terminates too.
How much of an issue any of that is depends on what appplication you're running. If it doesn't play nicely, doing this from the shell may not be the best option. In that case you're probably better off going with AppleScript, which you can ask about on Ask Different.