Created
January 4, 2017 17:41
-
-
Save IanMulvany/aa22dcd2ff07a7bdb9aca0159cbff38b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set now to (current date) | |
-- midnight this morning | |
set today to now - (time of now) | |
-- midnight tomorrow morning | |
set future to (today) + (336 * 60 * 60) | |
tell application "Calendar" | |
-- delete existing events in Sage Copy calendar | |
repeat with anEvent in (get events of calendar "sage") | |
delete anEvent | |
end repeat | |
-- find events in Outlook calendar that are happening in the next two weeks, and copy them to "sage" | |
repeat with anEvent in (get events of calendar "Calendar" whose start date is greater than or equal to today ¬ | |
and start date is less than or equal to future) | |
copy anEvent to the end of events of calendar "sage" | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment