Outlook for Mac

Applescipt OutLook Mac get email address of first to recipient

待回答 0 个回答

较早的帖子,发布于 2016年3月18日。 其中的信息可能已经过时。

本帖暂无中文翻译,以下为英文原文。

问题 提问于 2016年3月18日

Hi,

I need help to get the email address of the to recipient for sent messages

Here is my Script, but bei the bold marked line I get a type class:unresolved address

What I'm doing wrong ?

Thank you

tell application "Microsoft Outlook"
    
    set accountSpecifier to "Home"
    set mailBoxSpecifier to "INBOX"
    set myMailBox to mail folder "INBOX" of imap account accountSpecifier
    
    set currentMessage to 1st message of myMailBox
    
    set firstMessage to 1
    set lastMessage to (get count of messages in myMailBox)
    set listOfEmails to {}
    
    set StartMessage to 1
    if lastMessage > 10 then
        set StartMessage to (lastMessage - 10)
    end if
    
    repeat with thisMessage from StartMessage to lastMessage
        set currentMessage to message thisMessage of myMailBox
        set theID to id of currentMessage
        set theDate to time sent of currentMessage
        try
            set theSubject to subject of currentMessage
            set theRecipient to email address of to recipient 1 of currentMessage
            log theRecipient

            -- (*address:*** Email address is removed for privacy ***, type class:unresolved address*)

        end try
    end repeat
end tell

暂无回答

撰写回答

您的邮箱地址不会被公开。请勿发布密码。

This site uses Akismet to reduce spam. Learn how your comment data is processed.