Friday
Oct282005
AppleScript, Export iCal Birthdays to Remind
Friday, October 28, 2005 at 2:00
Another AppleScript to export all Birthdays from iCal to remind-formated text file:
property reminders_path : POSIX path of ((path to home folder) as text) & "Reminders/Birthdays.txt"
property days_in_advance : 7 -- how many days in advance to remind
tell application "iCal"
do shell script "mv " & reminders_path & " " & reminders_path & ".bak"
set this_calendar to first calendar whose title contains "Birthdays"
repeat with this_event in every event of this_calendar
tell this_event
set es to summary as string
set n to offset of "’" in es
set l to length of es
set event_summary to (text 1 thru (n - 1) of es) & "'" & (text (n + 1) thru l of es)
set start_date to start date
set date_string to (((month of start_date) as string) & " " & (day of start_date) as string)
set reminder_string to date_string & " +" & days_in_advance & " MSG " & event_summary & " %b.%"
do shell script "echo \"REM " & reminder_string & "\" >> " & reminders_path
end tell
end repeat
end tell
Make sure to update reminders_path and days_in_advance properties according to your situation and/or liking.
P.S. I promise it's the last one. At least for a little while.
tagged
technology
technology 
Reader Comments