2012-08-24 19 views

回答

0

以下腳本應該做你需要的。您需要將標題從「主頁」更改爲您感興趣的日曆的名稱。而且您需要將結束日期從「20130902」更改爲您需要的任何內容(採用YYYYMMDD格式)。

無論出於何種原因,iCal中,似乎從這個結束日期減去1天,所以在這個例子中,結束日期都將被設置爲9月1日2013年

tell application "Calendar" 
    repeat with thisCal in (calendars whose title is "Home") 
    setEndDate of me to "20130902" for thisCal 
    end repeat 
end tell 

on setEndDate to endDate for thisCalendar 
    tell application "Calendar" 
    repeat with thisEvent in (events of thisCalendar) 
     if recurrence of thisEvent is not missing value and recurrence of thisEvent does not contain "UNTIL" then 
     set recurrence of thisEvent to recurrence of thisEvent & ";UNTIL=" & endDate 
     end if 
    end repeat 
    end tell 
end setEndDate 
相關問題