从今天开始';使用Applescript从iCal中删除事件

从今天开始';使用Applescript从iCal中删除事件,applescript,icalendar,Applescript,Icalendar,我迭代了iCal中的所有事件,只得到今天的事件,但我认为这不是有效的。是否有只获取今天事件的函数/方法 tell application "iCal" tell calendar "Lotus Notes" set today to (current date) set this_year to year of today set this_month to month of today set this_day to da

我迭代了iCal中的所有事件,只得到今天的事件,但我认为这不是有效的。是否有只获取今天事件的函数/方法

tell application "iCal"
    tell calendar "Lotus Notes"
        set today to (current date)
        set this_year to year of today
        set this_month to month of today
        set this_day to day of today

        repeat with c in every event
            set d to start date of c
            set the_year to year of d
            set the_month to month of d
            set the_day to day of d
            if (the_year = this_year) and (the_month = this_month) and (the_day = this_day) then
                show c
            end if
        end repeat
    end tell
end tell
试试这个:

set {year:y, month:m, day:d} to current date
set str to (m as string) & " " & (d as string) & " " & (y as string)
set today to date str
set tomorrow to today + 60 * 60 * 24

tell application "iCal"
    tell calendar "Lotus Notes"
        set curr to every event whose start date is greater than or equal to today ¬
            and start date is less than or equal to tomorrow
    end tell
end tell

这不会得到今天发生的任何重复事件,这些事件最初是在早期定义的。看起来这是一个棘手的问题,看看其他答案,人们似乎正在使用