Created
February 25, 2012 01:51
-
-
Save mattyo161/1905207 to your computer and use it in GitHub Desktop.
Applescript for getting list of yearly events from iCal
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
tell application "iCal" | |
set results to "" | |
set todaysDate to current date | |
repeat with a in every calendar | |
set results to results & return & (name of a) | |
tell a | |
set eventList to {} | |
repeat with b in every event | |
if (recurrence of b) = "FREQ=YEARLY;WKST=SU" then | |
set startDate to start date of b | |
set eventMonth to (month of startDate) as integer | |
set eventDay to (day of startDate) as integer | |
set eventString to "" | |
if (eventMonth < 10) then | |
set eventString to eventString & "0" | |
end if | |
set eventString to eventString & eventMonth | |
if (eventDay < 10) then | |
set eventString to eventString & "0" | |
end if | |
set eventString to eventString & eventDay | |
set eventString to eventString & " - " & (summary of b) | |
set results to results & return & tab & eventString | |
end if | |
end repeat | |
end tell | |
end repeat | |
get results | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Script will loop through all calendars in iCal and output an indented list of events with Month and Day along with Event Summary.
Ex.
Friend Events
0119 - A...'s Birthday
0605 - D...'s Birthday
1023 - K...'s Birthday
1109 - K...'s Birthday