Mac to extract HTML from Mail messages

拜拜、爱过 提交于 2019-12-11 19:26:48

问题


I am trying to extract HTML from emails using AppleScript. I came across this StackExchange post -- Mac Automator/Applescript(?) to extract URL's from Mail messages -- which tries to extract URLs from email content. The extraction code is:

on run {input, parameters}
    set mailContentList to {}
    tell application "Mail"
        repeat with selectedMail in input
            set end of mailContentList to content of selectedMail
        end repeat
    end tell
    return mailContentList
end run

This only extracts the visible content, not the entire HTML content. I tried adding with properties {visible:false} after content and then after input with no luck from either.


回答1:


You get the raw source with the source property

set end of mailContentList to source of selectedMail

but you have to extract the HTML portion "manually".



来源:https://stackoverflow.com/questions/37582075/mac-to-extract-html-from-mail-messages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!