Mac从邮件中提取HTML [英] Mac to extract HTML from Mail messages

查看:306
本文介绍了Mac从邮件中提取HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用 AppleScript 从电子邮件中提取 HTML 。我遇到了这个StackExchange后 - Mac Automator / Applescript(? )从邮件中提取网址 - 该网址试图从电子邮件内容中提取网址。提取代码是:

 运行{输入,参数} 
将mailContentList设置为{}
tell应用程序邮件
在selectedMail中重复输入
将mailContentList的结尾设置为selectedMail的内容
结束重复
结束tell
返回mailContentList
结束运行

这只会提取可见内容,而不是整个 HTML 内容。我尝试在 content 之后,然后在 input 之后添加带有属性{visible:false} code>没有任何运气。

解决方案

您使用来源获取原始来源属性

 将mailContentList的结尾设置为selectedMail的源

但是您必须手动提取HTML部分。


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.

解决方案

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".

这篇关于Mac从邮件中提取HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆