Challenge 2: The Monday 8am Status Email — Solution Walkthrough The Apps Script function: function sendWeeklyStatusEmail() { var doc = DocumentApp.getActiveDocument(); var wordCount = doc.getBody().getText().split(/\s+/).length; var recipient = "team-lead@example.com"; var subject = "Weekly Report Status"; var body = "Current report word count: " + wordCount; MailApp.sendEmail(recipient, subject, body); } The trigger: In the Apps Script editor's Triggers panel, add a new trigger for sendWeeklyStatusEmail, choosing a time-driven trigger set to "Week timer," Monday, and the 8am-9am time window. Google's own infrastructure then calls this function automatically at that time every week, with nobody needing to open the Doc, run anything manually, or even be signed in at the moment it fires. Why this matches Chapter 7's own point: This is the same capability Chapter 7's own scheduled-email example demonstrated: DocumentApp and MailApp both run on Google's servers as part of the script's execution, not inside anyone's browser session, so the email genuinely goes out with nothing open anywhere — the exact capability a locally-running VBA macro could not replicate without a separate operating-system-level scheduler and a running copy of the desktop application. WHY THIS WORKS AS AN ANSWER ------------------------------ This exercise asks for the concrete script and trigger setup behind this capstone's own Step 7 reference, directly applying Chapter 7's DocumentApp/MailApp pattern (rather than SpreadsheetApp, since the report itself lives in a Doc, not a Sheet) to a slightly different but structurally identical automation task.