Applescript或Automator在Outlook Mac 2011中应用规则

cra*_*535 2 macos outlook applescript automator outlook-2011

我有一个本地邮件规则,我想按计划申请.要手动应用所有规则,我可以单击"消息"菜单 - >"规则" - >"应用" - >"全部应用".

有没有办法使用Applescript自动执行此操作?我查看了字典中的Outlook,但没有找到任何与规则相关的操作.

或者,有没有办法用Automator做到这一点?

ada*_*amh 5

可以使用GUI脚本来解决,使用System Events应用程序点击菜单项.

你最终得到很长的菜单引用,但它的工作原理.

编辑:我已添加了如何确保首先选择收件箱.

tell application "Microsoft Outlook"
    activate
    if main windows is {} then -- no windows open
        make new main window
    end if

    tell main window 1 to set view to mail view -- ensure its viewing mail

    set the selected folder to inbox    
end tell

tell application "System Events"
    tell process "Microsoft Outlook"
        click menu item "Apply All" of menu 1 of menu item "Apply" of menu 1 of menu item "Rules" of menu 1 of menu bar item "Message" of menu bar 1            
    end tell
end tell
Run Code Online (Sandbox Code Playgroud)