Mail.app Save Email to Path

Hiya folks.

I need to save my router log in a destination folder for further scripts to analyze. I’m triggering the AS so that’s not the problem. I’m getting permissions issues writing to a 770 directory:

An error occurred: Mail got an error: File not open with write permission.

/Users/rich/RF/Reference/router_logs

How can I fix this?

Cheers

A great resource. Thank you.

on writeTextToFile

…did the trick after grabbing the body of the email.