Automator/AppleScript 在 Mac Mail 中处理传入的电子邮件 [英] Automator / AppleScript to process incoming emails in Mac Mail

查看:26
本文介绍了Automator/AppleScript 在 Mac Mail 中处理传入的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计一个应用程序,如果我的应用程序崩溃,它允许用户通过电子邮件向我发送崩溃报告.我想让 Mac Mail 在计算机上运行,​​当电子邮件通过时,自动脚本/AppleScript 会运行以处理电子邮件正文的内容.

I'm designing an app that allows users to email me crash reports if my app ever crashes. I'd like to leave Mac Mail running on a computer and when an email comes through, an automator script / AppleScript runs to process the contents of the body of the email.

我已经在 python 脚本中完成了整个解析/处理,除了我必须手动将电子邮件的内容复制到一个文件中,然后在该文件上运行我的解析器.

I've got the entire parsing/processing done in a python script, except I have to manually copy the contents of the email into a file and then run my parser on that file.

进行此设置的最佳方法是什么,以便我可以将电子邮件的内容推送到我的解析脚本中?

What's the best way to set this up so I can the contents of the email be pushed into my parsing script?

非常感谢!

推荐答案

可能最简单的方法是定义 Mail.app 规则.您可以设置过滤条件来指定一组传入电子邮件以将规则应用到您可以指定的规则操作中,即对传入消息运行 AppleScript.规则由 Mail.app Preferences -> Rules 管理.Apple 提供了 Mac OS X 规则操作脚本的示例.在 /Library/Scripts/Mail Scripts/Rule Actions 中查找或搜索网络.

Probably the simplest approach is to define a Mail.app Rule. You can set up filtering conditions to specify the set of incoming email to apply the rule to and among the rule actions you can specify is one to run an AppleScript on incoming messages. Rules are managed with Mail.app Preferences -> Rules. Apple supplies examples of Rule Action scripts with Mac OS X. Look in /Library/Scripts/Mail Scripts/Rule Actions or search the web.

这篇关于Automator/AppleScript 在 Mac Mail 中处理传入的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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