繁体   English   中英

将AppleScript应用于邮件中的特定电子邮件

[英]Apply an AppleScript to a Specific Email Message in Mail

我有一个AppleScript,我想将其应用于单个电子邮件(将它们归档为具有特定文件名的PDF),但是无法确定如何将其应用于特定的电子邮件。

我无法设置邮件规则来运行脚本,因为这只是我判断是否要从Mail中存档一个邮件规则。 尝试将其设置为服务,但是右键单击“邮件”中的电子邮件没有“服务”菜单。

有什么建议么?!

丰富

您如何计划指定哪些电子邮件? 如果通过手动选择它们,则可以“获取选择”。 这是一个简单的脚本,它将获取每个选定消息的主题和消息ID。

tell application "Mail"
    set mySelection to get selection
    set eMails to {}
    repeat with selectedMessage in mySelection
        set messageId to selectedMessage's message id as string
        set eMail to selectedMessage's subject & ": " & messageId
        tell me to set end of eMails to eMail
    end repeat
    set AppleScript's text item delimiters to "\n\n"
    set the clipboard to (eMails as string)
end tell

将其保存在〜/ Library / Scripts / Applications / Mail /中,它将显示在“脚本”菜单中。 您可能必须转到AppleScript编辑器的设置以“在菜单栏中显示脚本菜单”才能显示“脚本”菜单。

(注意:编译此脚本时,\\ n \\ n会变成新行。)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM