This Studio teaches built-in service methods. The function runTask is a small entry point around those calls, not the subject of the lesson.
| Need | Project and method |
|---|---|
| A menu or sidebar inside one Sheet | Bound project; SpreadsheetApp.getUi() |
| Work with the bound parent in its editor | Bound project; getActiveSpreadsheet() |
| A scheduled job or several known files | Explicit IDs, often a standalone project; openById() |
| Drive inventory or document generation | Either project type with authorized access; explicit resource methods |
Special active-file methods rely on a supported bound execution context. They are not available merely because a bound project is deployed as a web app. UI interaction requires the open bound editor.
Google: container-bound scripts ↗Opening by ID does not confer access. The executing account still needs the right permissions. Installable triggers run as their creator.
Google: standalone scripts ↗ · Installable triggers ↗SpreadsheetApp.openById(id) // Spreadsheet
.getSheetByName('Tasks') // Sheet or null
.getRange('A2:C4') // Range
.getValues(); // JavaScript array of rowsEach method belongs to the object before the dot. Check nullable results before continuing. A getValues array is a snapshot, not a live Range. To change cells call a setter on the Range.
The local practice engine logs modeled method calls and resource changes. It never authorizes your account, sends messages or installs Google triggers. Supported methods are a teaching subset; consult each linked reference for real behavior and limits. Lab.reset and Lab.snapshot exist only in this Studio and do not belong in your real scripts.
Creating files, drafts, events and triggers repeatedly can create duplicates. The project starters default to preview mode. Verify output ownership, recipients and repeat behavior before automating.