What happens when a script is put under the "Toolbar"/"Menu" script folder?

My apology for asking this very specific question: When a script is put under the “Toolbar”/“Menu” script folder, is the script recompiled every time DT is restarted?

The reason I am asking is about using “property” in the applescript. It seems that the variables that are defined under “property” are reset to their initial value after DT is started. I observed the outcomes through testing, but want to check whether it’s the recompilation causing this.

This is not a “problem” at all, but an element of consideration in the coding design of my script. For example, if I want user-entered variables to be persistent, I know that a DT’s script should always write the value to a plist or some file/field in DT.

Thanks

Scripts are cached while DEVONthink is running to speed up their execution, meaning that after a restart the properties are the original ones again.

Thank you very much!
No wonder running a script within DT3 is much faster than to run the same script from the system - there is always a small time delay in “initial” keys entry when same script is calling up a dialog box at OS level… It almost feel like the script (if it is activated at OS level) is compiling the on the run. I am guessing that when a dialog box is first shown up, the rest of the codes are still compiling at the background.