Skip to content

Instantly share code, notes, and snippets.

View fabianem's full-sized avatar

Fabian Kapuścik fabianem

  • Cracow, Poland
View GitHub Profile
@fabianem
fabianem / Code.gs
Last active May 5, 2024 11:57
Google Apps Script to count emails by sender in batches
// Google Apps Script for counting emails by sender in batches. Stopps and resumes after 5mins of processing to avoid reaching script runtime limit.
// 1. Allow required permissions
// 2. Add gmail service to project
// 3. Fill <your-email> in `runProcessor` function and adjust query if needed
// 4. Run function `runProcessor`
// 5. Result will be saved in a new spreadsheet
// Based on ideas from https://stackoverflow.com/a/59222719/5162536 and
// https://medium.com/geekculture/bypassing-the-maximum-script-runtime-in-google-apps-script-e510aa9ae6da