mrocek
asked on
MailApp Apple script help
I have never written an applescript, and would
very much appreciate any help that anyone could give.
I am trying to find a way to copy the long header information
from all the messages in my junk mail box into a single
document; I then send the information on to our system
manager, who uses it to control spam.
Any suggestions will be appreciated.
very much appreciate any help that anyone could give.
I am trying to find a way to copy the long header information
from all the messages in my junk mail box into a single
document; I then send the information on to our system
manager, who uses it to control spam.
Any suggestions will be appreciated.
Hmmm, not quite sure how you want to go about that one. Writing an applescript would work, but youre going to need more than a basic understanding of applescript to do it. It might just be easier to show the package contents on your Junk mailbox in the ~/library/mail folder. Find the mbox file within it, and send them the file. It's got all the junk with headers. If you wanted to clean it up for them, you could write a grep search/replace in BBEdit which would be easier than applescript.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I just noticed a dumb error in my poste. We need to parse the mbox file inside the Junk.mbox directory:
awk '/^[Ff]rom / { inhead = 1 }; /^$/ {if (inhead) { print; inhead = 0; }}; { if (inhead) print; }' ~/Library/Mail/Mailboxes/J unk.mbox/m box > ~/Desktop/JunkHdrs.txt
awk '/^[Ff]rom / { inhead = 1 }; /^$/ {if (inhead) { print; inhead = 0; }}; { if (inhead) print; }' ~/Library/Mail/Mailboxes/J