I want to outsource all of my code to a library, however I am using ScriptProperties to set and get persistent, global variables (like "mode" : "edit" or "data") for every spreadsheet that uses the code.
According to the specifications it is not possible to have a library write to the hosting scripts ScriptProperties: https://developers.google.com/apps-script/guide_libraries#scoping
Script Properties(**): The same instance is visible to all including scripts when created in the library.
** This means that library has its own instance of the resource/feature and that all scripts that use the library share and have access to that same instance.
So this makes it impossible to set globals for every spreadsheet using one single code library.
Is there a workaround or a solution to this shortcoming of Libraries in combination with ScriptProperties?
Thanks and all the best
Mario
Or perhaps coded a little more elegantly, and more reusable…
Also included functions which are useful when a spreadsheet is used by more than one user, and they each need to have their own settings.