Send all Inbox drafts to Trash?

Without selecting any drafts, what script will move all Inbox drafts to trash?

This line should do it.

Draft.query("", "inbox", []).forEach(function(d){d.isTrashed = true;d.update();});
  • Get all inbox drafts.
  • For each draft, set it as trashed and update it.

Not completely tested (I tried with a tag in the query too) - Iā€™m not in a position to start trashing my entire inbox contents!

2 Likes

That worked. Thank you.