Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
Created September 11, 2011 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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
@talkingmoose
Copy link
Author

"Add contact birthdays to calendars.scpt" in an AppleScript that will locate all birthdays within Outlook for Mac's contacts lists and add them to a "Birthdays" calendar for the designated year.

To create the script:

  1. Open the AppleScript Editor.app application found in the /Applications/Utilities folder.
  2. Copy/Paste the above AppleScript code into an empty AppleScript Editor window.
  3. Save this script as "Add contact birthdays to calendars.scpt" and place it into ~/Documents/Microsoft User Data/Outlook Script Menu Items.

To use the script:

  1. Create a new calendar called "Birthdays" in Outlook. This must be the only calendar with this name.
  2. Select "Add contact birthdays to calendars" from the AppleScript menu next to the Help menu in Outlook. Follow the prompts.

@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