I just faced a similar issue about setting-up debug script automatically.
I cloned a project which is properly working and rename the project and board then I faced the same issue.
Creating a custom script by myself works fine as someone mentioned it, but I finally find another solution
for my custom board.
The procedure is as follows.
Step1 Confirm the project’s MCU and Board from project’s property (C/C++ Build->Setting) and make sure the BoardName.xml file is in the project folder.
Step2 Remove the project from workspace (Don’t delete the content).
Step3 Start creating a new AC6 C/C++ project and select same MCU and Board( you confirmed in step 1 ) but don’t proceed more.
Step4 In the MCU + Board select dialog Push the “Remove this Custom Board” Button to remove the board shown in Step1
Step5 Confirm the Board select menu and if the board still remains in the menu, cancel the creation procedure and restart from Step3
Step6 Close and Restart SW4STM32 and reimport the project removed in Step2.
Step7 Select the imported project and Debug As -> Ac6 C/C++ Application
This solved the issue at least in my case.