Preface
There is an important difference between scope and a script (or project).
Properties
PropertiesService
accesses resources scoped to a particular access level, each determining what will and will not be shared in different execution contexts (standalone, bound to document or Web App). There are 3 access levels that have distinct scopes:
- Script - available to all users regardless, a global scope so to speak
- Document - available to all users, but limited to current (container) document
- User - limited to the user under which authority the script runs
Projects
Apps Script Projects have a well-defined and consistent meaning, to quote the documentation:
A script project represents a collection of files and resources in Google Apps Script
Note that a script project is more than a mere sum of its files, it has a notion of resources. There are currently 3 groups of resources that can be associated with an Apps Script project:
- Libraries - acts as a stand-in for modules
- Cloud Platform project - controls quotas, permissions and access
- Advanced Google Services - thin wrappers around corresponding REST APIs
How does this answer the question?
Although getScriptProperties()
method deals with the "script" scope it does so insomuch the resources represented (properties storage) will be accessible anywhere in the execution context (provided being reachable, ofc) of the script, not the project as it represents more than that.
The difference becomes more apparent in the complexity Libraries bring in as multiple projects share library's ScriptProperties
(if it exposes them), but each have their own instance as well.
It is true that the glossary states that script projects are "sometimes referred to simply as "the script"" but it does not say that whenever you encounter the term "script" you can substitute "project", and vice versa.
Whole structure visualized:
+----------------------------------+
| Project |
| +------------------------------+ |
| | Script | |
| | +--------------------------+ | |
| | | .gs files | | |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | .html files | | |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | appsscript.json manifest | | |
| | +--------------------------+ | |
| +------------------------------+ |
| +------------------------------+ |
| | Resources | |
| | +--------------------------+ | |
| | | Libraries | | |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | Cloud Platform Project | | |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | Advanced Google Services | | |
| | +--------------------------+ | |
| +------------------------------+ |
| +------------------------------+ |
| | Properties | |
| | +--------------------------+ | |
| | | ScriptProperties | | |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | DocumentProperties | | |
| | +--------------------------+ | |
| | | UserProperties | | |
| | +--------------------------+ | |
| +------------------------------+ |
+----------------------------------+