Guest User

Untitled

a guest
Jan 22nd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. tell application "Microsoft Outlook"
  2.  
  3. set contactList to every contact
  4.  
  5. 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)
  6. if theYear as integer ≤ 1904 or theYear as integer ≥ 2039 then
  7. display dialog "You must specify a year between 1904 and 2039." with icon stop with title "Error!" buttons {"Cancel"}
  8. end if
  9.  
  10. repeat with aContact in contactList
  11. if birthday of aContact is not missing value then
  12. set theBirthday to birthday of aContact
  13. set year of theBirthday to theYear
  14. 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}
  15. end if
  16. end repeat
  17.  
  18. display dialog "Birthdays for the year " & theYear & " have been added to your Birthdays calendar." with icon 1 buttons {"OK"} default button {"OK"}
  19.  
  20. end tell
Add Comment
Please, Sign In to add comment