Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Add alarms to all existing iCal birthday events' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Add alarms to all existing iCal birthday events
Authored by: jdfrankl on Oct 13, '09 11:15:54AM
The following script creates a message alarm with sound. The problem with this is that since birthdays are all-day events, setting the alarm to go off exactly 10 days in advance means the alarm gets set to go off at midnight. Since I sync my calendar to my iPhone I don't want a sound alarm going off at midnight for a birthday 10 days in the future. To fix that I also changed the alarm interval to 9 days and 16 hours so the alarm gets set to go off at 8 AM instead of midnight.
tell application "iCal"
	tell calendar "Birthdays"
		set all_events to every event
		repeat with this_event in all_events
			tell this_event
				delete every sound alarm
				delete every display alarm
				make new sound alarm at end with properties {trigger interval:-13920}
			end tell
		end repeat
	end tell
end tell

[ Reply to This | # ]