在 OSX Microsoft Outlook 15中,給所選的郵件添加標(biāo)簽(Category)

在 OSX Microsoft Outlook 15中,給所選的郵件添加標(biāo)簽(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
    -- 在所選的郵件中重復(fù)
    repeat with theMessage in selectedMessages
        -- 給選擇的每一個郵件設(shè)置標(biāo)簽也就是"Category", 注意這個標(biāo)簽是已經(jīng)存在于 Microsoft Outlook 中的哦。
        set category of theMessage to {category "TagYouWant"}
    end repeat
end tell


如果你想設(shè)置的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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容