Installing:
- Click on the Archive Selected Messages by Date.applescript in the file list above
- Right click on the 'Raw' button at the top of the file listing
- Select Download Linked File
- In Finder us the Go > Go to Folder.. menu item and enter ~/Library
- In the Library folder, create a Scripts > Applications > Mail folder hierarchy
- Move the downloaded folder into the Mail folder
You can then invoke a couple different ways:
- Open /Applications/Utilities/Script Editor.app
- Open its preferences and enable the Show Script menu in menu bar
- This should put a menu extra on the right side of the menu bar that will have a "Archive Selected Messages by Date" option
Alternatively if you prefer a keyboard shortcut:
- Install FastScripts from https://redsweater.com/fastscripts/ and buy a license
- Open it up (it will also add a menu extra)
- Open its preferences
- In the General tab, set Open FastScripts when you log in to your Mac
- In the Keyboard Shortcuts tab, expand the Library/Scripts/Applications/Mail hierarchy and assign a shortcut. I used control-command-1k (though this replaces Mail's default Move to All Inboxes keyboard shortcut)
The second option is a little faster once you get your preferred keyboard shortcut memorized