Home > Enterprise >  Apps Script persistent variable across all scripts?
Apps Script persistent variable across all scripts?

Time:03-02

I am trying to get a variable to work in all instances of all scripts across my user account to prevent unwanted scripts in different documents running if the variable is set. I've managed to do this by creating a file on Google Drive but it's too slow really.

I know about PropertiesService but according to the documentation this seems to only be specific to the current script or document. Is there any fast way to create a persistent variable accessible from anywhere in the google account via apps script?

CodePudding user response:

There are several options

  • Use a project to create installable triggers instead of simple triggers,
  • Use a library,
  • Create a Workspace add-on
  • Create an Editor Add-on

On any of the above use the Properties Service and getScriptProperties instead of copies of the same script.

  • Related