Family objects Also have a UID (Templates.UID)
Suggestion:
Give that "text" an instance variable: ToDelete (number)
Below set Text action, add:
set value ToDelete = Templates.UID
add a condition to that delete:
Famlity Templates >> pick by UID (Text.ToDelete)
Action Templates destroy
This will leave your object name mechanic intact and add functionality to delete the template based on it's unique ID.
Ooof, ok took me some time to visualise this since I'm a very visual person, but thanks to it, I understood. Thank you so much and it works like a charm, also, I can use the method for the other tools! You are awesome.