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

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

问题描述

我正在尝试使用 AppleScript 从电子邮件中提取 HTML.我看到了这篇 StackExchange 帖子——Mac Automator/Applescript(?) 从邮件消息中提取 URL -- 它试图从电子邮件内容中提取 URL.提取码为:

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

这只会提取visible 内容,而不是整个HTML 内容.我尝试在 content 之后添加带有属性 {visible:false} 的 ,然后在 input 之后添加,但都没有运气.

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.

推荐答案

您可以通过 source 属性获取原始源

You get the raw source with the source property

set end of mailContentList to source of selectedMail

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

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

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

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