if that console stops running and returns an error...
# tornadofx
a
if that console stops running and returns an error, your script that starts the console and keeps track of the state would detect that error (whatever indicates the app has stoped working) and have your scripting restart the app