在 OSX Microsoft Outlook 15中,给所选的邮件添加标签(Category)

在 OSX Microsoft Outlook 15中,给所选的邮件添加标签(Category)
tags: macOS, AppleScript, Microsoft Outlook

tell application "Microsoft Outlook"
    
    -- 获取所选邮件
    set selectedMessages to current messages
    
    -- 无邮件选取通知
    if selectedMessages is {} then
        display dialog "NO MESSAGES SELECTED." with icon 1
        return
    end if
    -- 在所选的邮件中重复
    repeat with theMessage in selectedMessages
        -- 给选择的每一个邮件设置标签也就是"Category", 注意这个标签是已经存在于 Microsoft Outlook 中的哦。
        set category of theMessage to {category "TagYouWant"}
    end repeat
end tell


如果你想设置的Category不在 Microsoft Outlook 中怎么办? 你不会想手动在 Microsoft Outlook 中添加的吧?那么试着用下边的脚本吧:

set _categoryName to "YouPreferredCategory"
tell application "Microsoft Outlook"
    try
        -- Getting by name doesn't always work.
        repeat with _category in categories
            if _category's name is _categoryName then return _category
        end repeat
    end try
    make new category with properties {name:_categoryName}
    return category _categoryName
end tell
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容