How to run plugin code when a new place is created

I created a template plugin that has an option to automatically apply templates. I want to only automatically apply a template when you create a new studio project. I wouldn’t know how to run code when that happens however.

I am not sure this is possible, but any help would be great!

You can’t determine when a new place is open in Studio, however SetSetting is possibly what you seek for your specific use case. You can create a setting that determines if the plugin has been ran or not once on the place before. If a setting exists, don’t run code, otherwise do so and toggle the setting.

On that note, you may want to look into establishing a unique identifier somehow to prevent potential conflictions. I do believe plugin settings persist throughout all instances of Studio.