I'm new to the forum, but not new to KM.
Had some extra time on my hands and wanted to create a macro that would mark all my emails in my inbox as read and then archive them.
Actually what started this entire thing was wanting to go through my archive and mark all the very old emails as read so that I wouldn't have to see them as Unread in my iOS Airmail Client.
In any case, I could have done this all manually and marked all of the 800 or so unread messages as read, but why do that?
I'm sharing it in case anyone else wants to use it.
It's an action that can be repeated as many times as you need for the number of unread emails you have in your Gmail account. It would be good for you to figure out how many times you will need to run it by doing some simple math.
I used pauses throughout because I'm running this on a 2015 imac 5k and I wasn't in a hurry. Feel free to tweak to suit your needs.
Here are the steps the macro goes through:
1 - make Safari the active window (be sure you are on the tab that is opened to Gmail) and keep it up front.
Note that the Activating Safari step is outside the loop of repeating steps. You can move it inside the loop if you prefer. Leaving it outside the loop just means you shouldn't activate another window while this set of actions is working through your inbox.
2 - Pause for 1 second
3 - type the letter G (for Go To)
4 - type the letter I (for Inbox)
Note that you could also type the letter A to go to All Mail (aka archive)
5 - Pause for 1 second
6 - Press the Shift and 8 keys to simulate typing an asterisk (*) - this is equivalent to the "select" command/function.
7 - type the letter U (for unread messages)
8 - Pause for 2 seconds
9 - type the Shift and I keys (Gmail shortcut for Mark as Read)
10 - Pause for 1 second
11 - Type the letter E (Gmail shortcut for Archiving the selected messages)
12 - Pause for 1 second
If you don't want to archive messages, simply disable or delete the last two steps in the macro.
If you have pages and pages of emails in any folder or archive, this will save you quite a bit of time.
I hope this helps someone else who might be wanting to something similar.