home | tags | mulvany.net


Mail

save mailfolder messages to a file using applescript

I’ll just start by explaining that I hate applescript. I wanted to create a script that would take a specific folder withing the script and save each message from that folder to a text file on my machine for post-processing. This is what I came up with. set fileRoot to "Macintosh HD:Users:path:" set messageList to {} tell application "Mail" set messageList to messageList & (messages of mailbox "mailbox name" of account "account" of application "Mail") set counter to 1 repeat with theMessage in messageList set fileNum to counter as string set theFilePath to fileRoot & "mailcontent" & fileNum & ". ... (more)