我正在尝试建立一个系统,人们可以将电子邮件发送到某个地址,以将其电话号码添加到数据库中。我希望使用Automator来完成很多这方面的工作。到目前为止,这就是我的工作流程:
1. Get New Mail For: DEMO
2. Find Mail Messages where All of the following are true: Entire Message contains BEACH
3. Get Selected Mail Messages
4. Extract Phone Numbers From Text
5. New Text Edit Document
除非从文本中提取电话号码“没有提供所需数据,否则这样做。”别介意数据库内容 - 这是另一个问题 - 我如何从中提取电话号码Automator中的电子邮件的主题和发件人?我显然在某处做错了。
答案 0 :(得分:3)
您无法从邮件消息文本中提取数据,因为您实际上并未将文本传递给提取操作 - 您正在传递邮件消息对象。如果要处理邮件的发件人和主题,则必须在“从文本中提取数据”操作之前插入带有以下内容的“运行AppleScript”操作:
using terms from application "Mail"
on run {input, parameters}
set mailContents to {}
repeat with aMessage in input
set end of mailContents to subject of aMessage
set end of mailContents to sender of aMessage
end repeat
return mailContents
end run
end using terms from
- 这将遍历所有邮件消息对象,并将其发件人和主题属性附加到传递给“提取”操作的列表中。
关于工作流程的一些注意事项