0

我的用例是我想跟踪我写的一些消息的响应。我现在的方法是等待消息发送,然后将其从已发送文件夹移动到我定期检查的“等待回复”文件夹。

我正在寻找一种自动化的方法。最好是如果我按下一个键,使 Outlook 发送消息并将其放入等待文件夹中。例如,通过使用applescript。

或者,我认为按一个键会将我添加为密件抄送,并在消息底部添加一个“ WF ”字符串。再次,使用applescript。然后,当我发送邮件时,它也会到达我的收件箱,如果邮件包含“ WF ”,我将有一个规则将邮件移动到“等待”

4

1 回答 1

1

我将脚本从您的其他线程扩展到这里:

tell application "Microsoft Outlook"
    -- Simple definition of target mail folder
    -- Works fine this way if only one folder with this name is available
    set waitingForReplyFolder to folder "Waiting for reply"

    -- bring Outlook to front
    activate

    -- remember the front window
    set theWindow to window 1

    -- check it's really draft
    if class of theWindow is not draft window then
        display dialog "Not a draft"
        return
    end if

    -- save the draft
    save theWindow

    -- get the id of the object of the draft window
    set myObjectID to id of (object of theWindow)

    -- close the message window
    close theWindow

    -- checking the message' subject
    set theSubject to subject of message id myObjectID

    -- send the message
    send message id myObjectID

    -- check and wait until Outlook has moved the mail to the sent folder
    -- move it to target folder after we have found it
    set mailFoundAndMoved to false
    repeat 20 times
        -- check the next 20 message ids
        repeat with idCounter from 1 to 20
            try
                set freshSentMail to outgoing message id (myObjectID + idCounter)
                -- check if the subject is the same (just to be safe)
                if subject of freshSentMail is equal to theSubject then
                    -- move the sent mail to the "waiting for reply" folder
                    move freshSentMail to waitingForReplyFolder
                    set mailFoundAndMoved to true
                    exit repeat
                end if
            on error errstr
            end try
        end repeat
        if mailFoundAndMoved then exit repeat
        delay 0.5
    end repeat

end tell

现在你必须看看如何触发它。打开一条新消息,编写内容等并运行此脚本。它会发送邮件并将其移动到您的目标文件夹,就在它出现在已发送文件夹中之后。

干杯,迈克尔/汉堡

于 2014-09-30T14:59:01.277 回答