AppleScript使用电子邮件作为附件创建日历事件?

时间:2019-11-20 14:36:01

标签: macos outlook applescript

从Windows上的Outlook切换到Mac时,我错过了快速操作。我正在尝试找到一种方法来恢复它们,因为Mac应用程序中未实现它们。 到目前为止,我已经知道了,它工作正常。我只是无法弄清楚在日历事件中将所选电子邮件作为附件放置的部分。有人有主意吗?您可以将电子邮件作为附件转发,但是如何在日历事件中得到电子邮件?

tell application "Microsoft Outlook"
activate
set msgSet to current messages
if msgSet = {} then
    error "No Messages selected. Select at least one message."
    error -128
end if
set theMsg to item 1 of msgSet
set theAccount to account of theMsg
set archiveFolder to folder "ALL_THE_MAILS" of folder "Inbox" of theAccount

repeat with msg in msgSet

    -- get the information from the message, and store it in variables
    set theName to msg's subject
    set theCategory to category of msg
    set theContent to content of msg
    if theContent is missing value then
        set theContent to ""
    end if

    -- create a new event with the information from the task
    set newEvent to make new calendar event with properties {subject:theName, category:theCategory, content:theContent, start time:(current date), end time:(current date) + 3600}

    open newEvent

    -- Mark mails as read and move them to the archive folder
    set msg's is read to true
    move msg to archiveFolder

end repeat

结束告诉

谢谢!

0 个答案:

没有答案