【问题标题】:Apple Script to change all the events in iCal's end date to one specific date将 iCal 结束日期中的所有事件更改为一个特定日期的 Apple 脚本
【发布时间】:2013-02-28 09:25:35
【问题描述】:

我是 Mac 新手。我有大约 50 个未指定结束日期的重复事件。 我计划将所有重复事件更改为特定的结束日期。我正在寻找一个苹果脚本来一次更改它。谢谢!!

【问题讨论】:

    标签: macos applescript


    【解决方案1】:

    以下脚本应该可以满足您的需求。您需要从“主页”将标题更改为您感兴趣的日历名称。您需要将结束日期从“20130902”更改为您需要的任何日期(格式为 YYYYMMDD)。

    无论出于何种原因,iCal 似乎从该结束日期中减去了 1 天,因此在此示例中,结束日期将全部设置为 2013 年 9 月 1 日。

    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-23
      • 1970-01-01
      • 2020-04-22
      相关资源
      最近更新 更多