I asked ChatGPT:
Create a Google Gmail script to automatically delete emails older than 7 days that have the label '7-Days'.
Create a Google Gmail script to automatically delete emails older than 7 days that have the label '7-Days'.
Within a few seconds, I got this response:
Could it be that simple, I asked myself?
There's only one way to find out, so I copied the code and went to https://script.google.com for my Gmail account and created a new project, and pasted the code.
Saved and Run, I had to authorise the use of the script.
Following the ChatGPT instructions on how to set up, I created the trigger to run once an hour, and saved that.
I was sceptical about whether it would work, but - and admittedly it's early days yet - the script does appear to work!