【问题标题】:Mac to extract HTML from Mail messagesMac 从 Mail 信息中提取 HTML
【发布时间】:2016-10-01 14:43:10
【问题描述】:

我正在尝试使用AppleScript 从电子邮件中提取HTML。我遇到了这个 StackExchange 帖子——Mac Automator/Applescript(?) to extract URL's from Mail messages——它试图从电子邮件内容中提取 URL。提取码为:

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 之后添加with properties {visible:false},然后在input 之后添加,但都没有运气。

【问题讨论】:

    标签: html macos email applescript automator


    【解决方案1】:

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

    set end of mailContentList to source of selectedMail
    

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

    【讨论】:

      猜你喜欢
      • 2012-07-04
      • 1970-01-01
      • 1970-01-01
      • 2015-02-01
      • 2012-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多