【问题标题】:How to retrieve email body of outgoing mail in apple mail using applescript?如何使用applescript在苹果邮件中检索外发邮件的电子邮件正文?
【发布时间】:2012-12-21 02:20:34
【问题描述】:

我如何检索外发邮件的电子邮件正文、收件人电子邮件地址、主题等。

感谢您的帮助。

编辑:- 我在外发邮件工具栏中添加了一个自定义按钮,请参见图片。

该按钮的功能是发送邮件并将所有邮件详细信息也保存在我的服务器上,所以我怎样才能获得这些详细信息,例如, 两个电子邮件地址 "To"="test@gmail.com" 和 "cc"="test2@gmail.com", subject="My subject" 和 email body="My email body"

我怎样才能做到这一点?

【问题讨论】:

  • 您需要所有外发电子邮件的详细信息吗?按什么顺序排列?还是您只需要一封电子邮件?我们怎么知道是哪一个?
  • @Saturnix 请查看我编辑的问题。

标签: macos applescript apple-mail


【解决方案1】:

通过这个苹果脚本,您可以检索邮件内容,所以请尝试一下。

tell application "System Events"
    tell process "Mail"
        set _Contents to {}
        set _contentDetail to {}
        set the _contentDetail to entire contents of UI element 1 of scroll area 3 of window 1
        repeat with _value in _contentDetail
            set str to ""
            if class of _value is static text then
                set str to value of _value
            end if
            set str to str & return
            set _Contents to _Contents & str

        end repeat
        return get _Contents as string
    end tell
end tell

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-26
    • 2011-04-05
    • 2017-01-16
    • 2011-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-12
    相关资源
    最近更新 更多