Mac从邮件中提取HTML [英] Mac to extract HTML from Mail messages
问题描述
我试图使用 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屋!