Now that I think about the process method (second method), I can see three problems.
This method fails if while the file is opening, another application, manually or from another script is launched.
If you have an unsaved file, the first method, (exe.terminate) asks if you want to save the...