I just added a short script to my gig file’s global rackspace that runs in Initialization() and alerts me if a certain testing widget is “on” (i.e. it was saved that way). This is important because I never want to have saved the gig file in its “testing” state.
What would be even better is if GScript had a callback function that would be called whenever the gig file is about to be saved - I’d insert code that would set the testing widget to “off” before saving. Or it could be called when you quit GigPerformer, if there was a way to turn a widget off and re-save the gig file before GP exits.
There’s no script callback for when a gig is saved.
If the end goal is to ensure the widget is off when you next option the gig, then there are widget settings to specify an initial value when the gig is loaded.
While it may not be a bad idea to have such a callback, for your example, why would not have that widget configured so that it just always gets reset to 0 when you load a gigfile?