Setting element values at restart

Without storing the values of elements like sliders, text boxes which also can be used as inputs, etc every time we when open a Grasshopper definition, we have to set them again one by one in the UI window. How can we avoid this?

All objects that are used as input should retain their values when saved and opened again. Panels, sliders, toggles, swatches, dials, … everything.

Can you upload a *.gh file which has a panel that is empty when opened?

I am talking about elements in a HUMAN UI window. ( I have used the HUMAN UI tag) in my topic header.
Actually I have discovered that I have to make sure that the values are saved, which can be done with SAVE and Restore State combo. But then there is a question…is it possible to trigger a boolean which is triggered automatically when a Grasshopper file is opened? Otherwise I have to create a “load values” button on every Human UI window I am using. Similarly, when saving a grasshopper file is there a boolean what I can use for saving the elements’ state?

Thanks, missed the tag. Can’t help you with Human UI.

The second part is not a HUMAN UI question:
“is it possible to trigger a boolean which is triggered automatically when a Grasshopper file is opened? Otherwise I have to create a “load values” button on every Human UI window I am using. Similarly, when saving a grasshopper file is there a boolean what I can use for saving the elements’ state?”