首页 > 解决方案 > 使用 Applescript 或 Automator 编辑日历以将所有事件“向前移动”一天

问题描述

我希望能够将我的 mac 日历中的所有事件向上移动一天,最好能够排除周末。

用例:一个培训计划有 10 周的每日课程。日历是通过 csv 上传的,针对开始日期和跳过的日期进行了编辑。如果一个人错过了一天,他们可以简单地将所有事件推进一天。

我看过 Automator,似乎没有一种简单的方法来设置它,除了可能的文件夹操作选项。

有人做过这样的事情吗?

标签: macoscalendarapplescriptscheduleautomator

解决方案


从 Catalina 开始,我会小心 AppleScripting Calendar.app,因为它现在非常有问题,并且在出现问题时很容易导致数据丢失。

但是,非脚本解决方案是在视图中查看事件时剪切和粘贴事件:

  1. 选择您希望提出的所有事件,最好从最后一个开始,这样您就可以在第一个结束;

    如果您取消选择所有其他日历,以便唯一可见的事件是您的培训计划中的事件(我认为这些事件存储在他们自己的日历中,对吧...?!),那么您可以⌘</kbd>A to Select All, being careful to deselect the ones that overlap from the previous month or into the next month. Individual events are selected/deselected by holding down ⌘</kbd> and clicking the event.

  2. ⌘</kbd>X to Cut them to the clipboard;

  3. 使用鼠标单击包含第一个事件的前一天;

  4. ⌘</kbd>V to Paste the events, the first of which will be pasted into the day that you clicked in step ⓷, with the remaining events repositioned by the same relative amount as was the first.


推荐阅读