Apple Mail: Loop through all emails in specific folder

Hi everyone,

I’m currently trying to create an automated email backup workflow with Keyboard Maestro and/or Apple Script. I want to save all emails in a specific folder within Apple Mail to be printed as PDF files. I was able to create a Keyboard Maestro macro, which does this for the currently selected email. However, I would like to do this for ALL emails in this folder.

I found a looping solution, which uses Apple Script here (see the answer there). I’m however not sure, how to combine Apple Script and Keyboard Maestro to a) loop through the folder with such Apple Script and b) run a Keyboard Maestro macro on every item (email message) found by this loop. Or is there an even simple solution just using Apple Script or Keyboard Maestro?

(I hope, it became clear what I’m trying to achieve (English is not my native language). If not, please let me know.)

After trying to solve this problem for hours, I just found out that it is possible to select all emails within a folder and print them to PDF. I created the shortcut as mentioned by Macsparky and will observe, if this solution does not annoy me in the long run. It’s not completely automated, but I think it does its job for now.

You can also use Email Archiver, although it is not cheap.