Correct way to handle build callbacks in script (buildStarted / buildEnded)

I am creating a custom script that build banks to a specific folder, rather than changing the build path in the preferences. The script will then fallback to the default path, not changing the default build behaviour.


Everything works fine except that once you have set the “listeners” to buildStarted and buildEnded, they live on. So if I build using my script, and then build using F7, the callback functions will run again.

Is there any way to remove the “listeners” to buildStarted and buildEnded? I can’t seem to find anything in the documentation.

I could skip the listeners and rely on the execution order but I rather learn something new. •͡˘㇁•͡˘



It looks like when the listeners were implemented it was under the assumption these would be done through one-off scripts run through the command line, so decoupling or having them as a one time use function was not considered. Therefore it’s not necessarily a bug, but it’s behaviour can definitely be improved.

I’ve raised a suggestion to improve these functions in a future release, thank you for bringing it to our attention.

1 Like

Thanks for your reply. I skipped the listeners for now.