AppleScript 在移动邮件消息后中止执行?
我将以下脚本与 Mail.app 规则一起使用。
在我的计算机上,将邮件移至垃圾箱邮箱后,代码似乎没有被执行。 (下面的 adayzdone 报告这对他有用)。
怎样才能查明出现这种情况的原因并解决呢?
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用邮件中的规则调用它,这个脚本对我有用。您确定邮件已到达收件箱,并且没有被 Gmail 中的“跳过收件箱”等过滤器捕获吗?
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?