| 1 |
tell application "Address Book" |
| 2 |
|
| 3 |
set bDayList to name of every person whose birth date is not missing value |
| 4 |
|
| 5 |
choose from list bDayList with prompt "Whose birthday would you like?" |
| 6 |
|
| 7 |
if the result is not false then |
| 8 |
|
| 9 |
set aName to item 1 of the result |
| 10 |
|
| 11 |
set theBirthday to birth date of person named aName |
| 12 |
|
| 13 |
display dialog aName & "'s birthday is " & date string of theBirthday |
| 14 |
|
| 15 |
end if |
| 16 |
|
| 17 |
end tell |
| 18 |
|
| 19 |
-- From https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html |