在outlook 2011中,如何使用applescript从一系列事件中获取事件?

时间:2015-04-29 09:36:37

标签: outlook applescript

在Outlook 2011中,我尝试使用以下代码从一系列事件中获取单个事件,但它显示错误“”Microsoft Outlook出错:指定的对象是属性,而不是元素。“数字-10008“。出了什么问题?

tell application "Microsoft Outlook"
    activate
    tell calendar 3
        tell calendar event 1
            get occurrence of at date "Wednesday 29 April 2015 00:00:00"
        end tell
    end tell
end tell

1 个答案:

答案 0 :(得分:1)

这是一个错误,当事件的重复出现错误,或者日期的时间错误(必须是事件开始日期的时间)或当天没有发生时,会发生此错误。

尝试此脚本,(更改第2行中的主题)

set tdate to date "Wednesday 29 April 2015 00:00:00"
set event_subject to "some title"
tell application "Microsoft Outlook"
    set myEvent to first calendar event of calendar 3 whose its subject is event_subject and its is recurring is true
    set sdate to start time of myEvent
    tell me to set time of tdate to time of sdate
    try
        set thisCalEvent to get occurrence of myEvent at tdate
    on error
        return "No occurrence of this event at " & tdate
    end try
    return thisCalEvent
end tell