Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment