0

我有一个邮件过滤器,它将运行一个自动脚本,该脚本将复制邮件内容,然后运行一个 Automator 应用程序。但是它不起作用。它不会启动 Automator 应用程序或复制内容。

所以我收到了一封电子邮件,它告诉这个 Applescript 运行。如果我进入并编辑 AppleScript(即使 24 小时后没有关闭,只有睡眠)并删除除最后一行之外的所有内容,然后单击保存 AppleScript 会启动应用程序。我感觉第一段代码有问题。当电子邮件进来时,我将 Mail 设置为发出声音,运行脚本并删除电子邮件,所以我知道脚本被告知运行。

  • 如何删除电子邮件文件?
  • 为什么只有在 AppleScript 编辑器中打开 AppleScript 后才会运行它的错误?这真的很愚蠢。

这是下面的当前 Applescript:

using terms from application "Mail"
    on perform mail action with messages matchmsgs for rule mailrule
        tell application "Mail"
            set msg to item 1 of matchmsgs
            set msgcontent to (content of msg) as Unicode text
        end tell
        set the clipboard to msgcontent
        tell application "/Users/me/Docs/Update App.app" to activate
    end perform mail action with messages
end using terms from
4

1 回答 1

0

我相信对于邮件规则,您的所有 applescript 代码都必须在on perform mail 操作中,消息 matchmsgs 用于规则 mailrule代码块。因此,尝试将告诉应用程序“更新应用程序”这一行移动到将剪贴板设置为 msgcontent的行之后。

于 2011-01-12T01:20:01.910 回答