I’m reading Deep Work by Cal Newton, which is inspiring some thoughts on how to reduce my attention to work at certain times of the day.
In particular, I’d love to setup a mail rule - either via Apple Mail Rules, Mail Act On, or Gmail rules, to move all messages received at certain times of the day to a different folder which I named “@later” similar to Sanebox.
I don’t see a straightforward way to setup this type of rule, so I’m wondering if there might be a script or plug in I could use to accomplish this desired outcome.
You could do this through Keyboard Maestro. Just set up a macro to trigger at a specific time and run an applescript that moves all mail to a folder .
something like this:
tell application "Mail"
set all_messages to (messages of mailbox "INBOX" of account "[account name]")
repeat with theMessage in all_messages
tell application "Mail"
move theMessage to mailbox "@later" of account "[account name]"
end tell
end repeat
end tell
Neither Apple Mail’s built in rules predicates nor Mail Suite’s (Mail Act On) can get more granular on time than Date Sent or Date Received. I think @JKoopmans suggestion is the way to go.
If you have it in script editor, does it compile ok?
Also: the inbox name is key, not all providers name them the same. so make sure you point to the inbox. (you can put an entry in the script to count all unread items f.e. and have that pop up as a message to trest wether it is the right mailbox)
Thanks, @JKoopmans! I ran this in the script editor and found that I needed to capital the ‘L’ in “@Later” to match the name of the destination folder.
So, the script is working now!
I’d still love to figure out how to repeat the script every minute or so until a certain time, if you have any insight into how to do that in KM.