I want to archive old emails ( say, older then 7 days ) from my inbox automatically with an applescript scheduled via cron.
To be honest, I am open to other Apple-friendly languages such as Swift or Coco , though the learning curve might be prohibitive for me.
Ideas, Examples, and links relevant to the topic are welcome.
Best Answer
To start with, you can try this Applescript:
Enter the above script in Script Editor, play with it till it does what you want, then save it as a script file (.scpt). run it with osascript(1).
Look at Applescript Resources and the Applescript Language Guide for more useful info. Also look at the scripting dictionary of Mail.app using the "Open Dictionary..." command in Script Editor to see what sort of things you can script in mail.