AppleScript的中止移动邮件后执行? [英] AppleScript aborts execution after moving a mail message?

查看:212
本文介绍了AppleScript的中止移动邮件后执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用下面的脚本用Mail.app规则。

看来,我的电脑不被消息移至回收站邮箱之后执行code。 (以下报告adayzdone它适合他)。

我如何能够确定这样做的原因和解决呢?

 使用从申请邮件条款
    在执行与信息theMessages邮件操作
        与eachMessage重复theMessages
            设置theText为eachMessage内容             -
             - ...在这里发生的一些处理
             -              - 这工作:
            移动eachMessage邮箱回收站             - 但这并不:
            显示对话框走到这一步             - 即额外的code我加入这里就不执行...
        重复结束
    最终执行与邮件的邮件操作
结束使用条款从


解决方案

从邮件的规则调用它,这个脚本为我工作。你确定该消息到达收件箱,一个过滤器不被抓到,如来自Gmail的收件箱跳过?

 使用从申请邮件条款
在执行与信息theMessages邮件操作
    与eachMessage重复theMessages
        设置theText为eachMessage内容
        移动eachMessage邮箱回收站
        显示对话框走到这一步
        嘟嘟2
    重复结束
最终执行与邮件的邮件操作
结束使用条款从

I'm using the following script with a Mail.app rule.

It seems that on my computer the code isn't being executed after moving the message to the Trash mailbox. (adayzdone below reports it works for him).

How can I identify the reason for this and solve it?

using terms from application "Mail"
    on perform mail action with messages theMessages
        repeat with eachMessage in theMessages
            set theText to content of eachMessage

            --
            -- ... here happens some processing
            --

            -- this works:
            move eachMessage to mailbox "Trash"

            -- but this doesn't:
            display dialog "reached this point"

            -- i.e. additional code I'm adding here isn't executed...
        end repeat
    end perform mail action with messages
end using terms from

解决方案

Calling it with a rule from Mail, this script works for me. Are you sure the message is reaching the inbox and not getting caught in a filter such as "skip inbox" from gmail?

using terms from application "Mail"
on perform mail action with messages theMessages
    repeat with eachMessage in theMessages
        set theText to content of eachMessage
        move eachMessage to mailbox "Trash"
        display dialog "reached this point"
        beep 2
    end repeat
end perform mail action with messages
end using terms from

这篇关于AppleScript的中止移动邮件后执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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