Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
Created September 11, 2011 20:16
Show Gist options
  • Save talkingmoose/1210066 to your computer and use it in GitHub Desktop.
Save talkingmoose/1210066 to your computer and use it in GitHub Desktop.
Add Outlook for Mac contact birthdays to calendar
tell application "Microsoft Outlook"
set contactList to every contact
set theYear to text returned of (display dialog "Enter the calendar year for new birthday reminders." default answer year of (current date) with title "Which year?" with icon 1)
if theYear as integer ≤ 1904 or theYear as integer ≥ 2039 then
display dialog "You must specify a year between 1904 and 2039." with icon stop with title "Error!" buttons {"Cancel"}
end if
repeat with aContact in contactList
if birthday of aContact is not missing value then
set theBirthday to birthday of aContact
set year of theBirthday to theYear
make new calendar event at calendar "Birthdays" with properties {subject:"Birthday - " & display name of aContact, start time:theBirthday, end time:theBirthday + 86400, all day flag:true, has reminder:true, reminder time:10080, free busy status:free}
end if
end repeat
display dialog "Birthdays for the year " & theYear & " have been added to your Birthdays calendar." with icon 1 buttons {"OK"} default button {"OK"}
end tell
@kaikoes
Copy link

kaikoes commented Oct 11, 2012

hi,

I am new to this and followed your instructions. I managed everything, but how do I add the birthdays since I have none in my calendar. so every time I add a birthday will it automatically be updated? I am confused?

@AtmiyaDas
Copy link

hi sir,
how to export all calendar event?
please give me apple script for export all calender data of outlook 2011 mac.

thanks

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