Sometimes the presence of a compiled application also stops the Build when ready to build the compiled app.
Here are a couple of scripts I have found useful:
(Note: need to be inserted prior to the final Build stage
// Kill builds script - Run on Debug
// Get the path of the project and strip off the project name
Dim projectPath as String = ProjectShellPath
// replace any “/” with empty string to fix path
projectPath = Replace(projectPath,"","")
'print projectPath
dim pa() as string = split(projectPath,"/")
// now remove the last item (Project name), leaving the project folder items as an array
pa.Remove(UBound(pa))
// Now create a string which holds the project folder
dim projectFolder as String = join(pa,"/")
'print projectFolder
Dim appPath As String = ProjectFolder + “/”“Builds - HH.xojo_project”""
Dim cmd As String = "rm -Rf " + AppPath
print appPAth
print cmd
Call DoShellCommand(cmd)
// Kill debug script - run on both Debug and Build
// Get the path of the project and strip off the project name
Dim projectPath as String = ProjectShellPath
// replace any “/” with “”
projectPath = Replace(projectPath,"","")
'print projectPath
dim pa() as string = split(projectPath,"/")
// now remove the last item (Project name), leaving the project folder items as an array
pa.Remove(UBound(pa))
// Now create a string which holds the project folder
dim ProjectFolder as String = join(pa,"/")
// Get the app’s name from the IDE
dim DebugAppName as String =“HH.app”
// Strip off .app if it’s there and append “.debug.app”
DebugAppName = Replace(DebugAppName,".app","") + “.debug.app”
// Replace any spaces in the name with '"
'DebugAppName = Replace(DebugAppName," “,”\ ")
// Make the full path
dim AppPath as string = ProjectFolder + “/” + DebugAppName
'print appPath
// Make the remove command
dim cmd as string = "rm -Rf " + AppPath
// Execute it
Call DoShellCommand(cmd)