【发布时间】:2013-02-28 04:56:06
【问题描述】:
我有以下 AppleScript(如下)。我正在尝试确认电子邮件的发送。这个 AppleScript 已经成功连接到 Mail.app 中的“发件箱规则”(使用 Mail Act-On),并且我已经验证它在它应该运行的时候(在发送时)运行。
最终目标是向用户弹出一个对话框,询问他们是否“真的”想要发送电子邮件。如果没有,请停止发送电子邮件。
当前脚本尝试删除该消息,但这不起作用。有什么想法吗?
using terms from application "Mail"
on perform mail action with messages messageList for rule theRule
repeat with thisMessage in messageList
set theResult to display dialog "Send?" buttons {"OK", "Cancel"} default button 2
if button returned of theResult is not equal to "OK" then
delete thisMessage
end if
end repeat
end perform mail action with messages
end using terms from
【问题讨论】:
标签: macos email applescript