How it works
GmailApp.search runs the same query you would type into Gmail’s search bar. `category:promotions OR category:updates` targets the two tabs that fill up fastest; `newer_than:7d in:inbox` scopes it to this week’s unarchived mail.
moveToArchive() removes the Inbox label without deleting anything — the thread stays in All Mail and search. Re-running is harmless: archived threads no longer match `in:inbox`.
The 200-thread cap keeps a single run well under Gmail’s per-execution limits. A normal week rarely exceeds it; raise it only if you also batch.