Stop a script from running if the file is not a template

I was wondering if there is a way of not running a script if it is a project.

The reason is I want to condense my template (delete some Sheets, rename some and change the classifications) when a project starts. I don’t want it to run if it is a true project because it could mess up so many things

my steps. of a convert a template from a large project to a smaller one

  1. Delete not used sheets (complete)
  2. change unused sheets classifications by a sheet parameter (complete) XX- Not Used
  3. rename the unused sheets changed in the classification (complete) XX-A1.01
  4. rename the used sheets to fill in the ones moved to not used or deleted. (complete)

some things I thought about is if it doesnt have a filename (starting a new project from a template doesnt have one. the filename appears after you save the file for the first time.,

Any help would be great ThanksCondense a Project.dyn (57.1 KB)