Automator/AppleScript 在 Mac Mail 中处理传入的电子邮件

编程入门 行业动态 更新时间:2024-10-17 21:24:22
本文介绍了Automator/AppleScript 在 Mac Mail 中处理传入的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在设计一个应用程序,如果我的应用程序崩溃,它允许用户通过电子邮件向我发送崩溃报告.我想让 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-17 15:08:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/915844.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:电子邮件   AppleScript   Automator   Mail   Mac

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!