Run Script automatically on part drawing open?

Is there a way to run a script automatically when I open orcreate a part drawing?

I need to check the BOM has a configuration selected. If not,select the correct config and update the BOM.
SolidworksApi macros