度々、失礼致します。 AppleScriptを使う場合の一つの方法として以下のスクリプトをAppleScript Editor.appで実行すると(Mail.appでメッセージせ選択した状態で実行)、デスクトップに受信日や送信者、タイトル、本文の内容をプレーンテキストファイルで書き出してくれます。 しかし、色々な状況に応じて微修正する作業も必要と思われます。 参考になれば幸いです。
tell application "Mail"
set messageList to selection# 選択しているメッセージをリスト化
repeat with thisMessage in messageList# リスト内のメッセージ毎に繰り返し
tell thisMessage
set theSender to sender & return # 送信者情報を得る+改行文字
set theDate to (date received as rich text) & return # 受信日+改行文字
set theSubject to subject & return # タイトル+改行文字
set theContent to content # 本文
end tell
my writeToFile(theSender, theDate, theSubject, theContent) # 書き出しへ
end repeat
end tell
on writeToFile(theSender, theDate, theSubject, theContent)
set thePath to (path to desktop folder) as text # デスクトップへのパス
set theFilePath to thePath & theSubject & ".txt" # タイトルが付いたファイル名を作成
set theFS to open for accesstheFilePath with write permission# 書き込み用にファイルを開く
try
writetheDatetotheFSas «class utf8» # 日付を書き込む。 as Unicode textとするとutf-16で書き出す。
write theSender to theFS as «class utf8»
writetheSubjecttotheFSas «class utf8»
writetheContenttotheFSas «class utf8»
on error
close accesstheFS# ファイルを閉じる
end try
close accesstheFS# ファイルを閉じる
end writeToFile