I have written a script to build and run my dotnet project but it seems I am not able to stop it. The code I wrote is below.

do shell script "eval $(/usr/libexec/path_helper -s)
cd /Users/Projects/sth.api
dotnet run &"

Upon triggering this script from Script Editor, I am not able to stop it again. I don't want my project to run all the time. Now I need to open Activity Monitor and find the dotnet application which is also impossible so I have to stop all dotnet projects.

I have exported script as Application, and clicked Show Startup Screen and Stay Open After Run Handler. That opens a dialog with Run and Quit buttons. I want to stop the dotnet project when I clicked the Quit button.


1 Answer 1


You need to remove the & character from the command. That character makes the command run in the background - i.e. the script completes right away even though your .NET program is still running.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .