# Neil Gandhi - Automatically Mark Archived Emails as Read (Highlights) ![rw-book-cover|256](https://readwise-assets.s3.amazonaws.com/static/images/article3.5c705a01b476.png) ## Highlights - Go to [script.google.com](https://script.google.com) and click on **New Project**. ([View Highlight](https://read.readwise.io/read/01kcpdzwxwbxv1rtekvaaacvte)) ^967443286 - Paste the following code block into the code editor and click the save button. ([View Highlight](https://read.readwise.io/read/01kcpe04p8rmkz3tny4jf2ft35)) ^967443295 There's a limitation that the API can only mark 100 emails as read. ``` function markArchivedAsRead() { var threads = GmailApp.search('label:unread -label:inbox'); GmailApp.markThreadsRead(threads.slice(0, 100)); }; ``` - Navigate to the **Triggers** page from the left nav menu and click **Add Trigger**. ([View Highlight](https://read.readwise.io/read/01kcpekc0n5h47qq6gvegdsbs0)) ^967444720