Skip to content

Instantly share code, notes, and snippets.

@mattyo161
Created February 25, 2012 01:51
Show Gist options
  • Save mattyo161/1905207 to your computer and use it in GitHub Desktop.
Save mattyo161/1905207 to your computer and use it in GitHub Desktop.
Applescript for getting list of yearly events from iCal
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
@mattyo161
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment