List Google accounts signed in on this browser (Gmail)
Automatically list Google accounts signed in on this browser (Gmail) on mail.google.com. List the Google accounts signed in on this browser, as the Gmail account switcher shows them. Each account comes back with its address, the index that addresses it in a Google URL, and whether it is the one Gmail opens by default. The index is what the other Gmail scripts take as their account argument, so this answers which account a script acts as when none is given.
Input
None
Output
count requiredaccounts requiredSigned-in accounts, ordered by index.
FAQ
Search Gmail
Search the signed-in Gmail with the native query syntax (from:, to:, subject:, has:attachment, after:/before:, labels…) and return matching threads: threadId (feed it to get_thread / reply_to_email), sender, senderEmail, subject, snippet, date, unread, starred, hasAttachment. Results are threads rather than individual messages, which is Gmail's own search granularity, and only the first page of results is returned (up to 50).
Send Gmail email
Send an email from the signed-in Gmail account, with a plain-text body and an optional single file attachment.
Forward Gmail thread
Forward an entire Gmail thread to one recipient, with an optional leading note. Takes the hex threadId that search_emails returns, and forwards the whole conversation inline rather than a single message. Returns forwarded, threadId and to. The thread must be on the first page of All Mail, newest-first, so older conversations cannot be reached this way.
