使用AppleScript阻止发件人

时间:2014-06-02 14:00:14

标签: outlook applescript outlook-2011

我想使用AppleScript阻止垃圾邮件发送者的地址。

选择收件箱消息后,我执行此脚本:

tell application "System Events"

    click menu item "Block Sender" in menu item "Junk Mail" in menu bar item "Message" in menu bar 1 of application process "Microsoft Outlook"

end tell

导致此错误:

  

系统事件出错:无法获取菜单项"垃圾邮件"菜单   bar item" Message"申请流程的菜单栏1" Microsoft   前景"

Junk Mail菜单有一个子菜单:

enter image description here

AppleScript编辑器已被授予访问权限以控制我的电脑:

enter image description here

我错过了什么?

1 个答案:

答案 0 :(得分:0)

我无法用Outlook测试它,但您错过了菜单项的“消息”和“垃圾邮件”菜单:

tell application "System Events"

    click menu item "Block Sender" in menu "Junk Mail" in menu item "Junk Mail" in menu "Message" in menu bar item "Message" in menu bar 1 of application process "Microsoft Outlook"

end tell