Re: birth date from Address Book
Re: birth date from Address Book
- Subject: Re: birth date from Address Book
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 12 Mar 2003 08:52:54 -0800
On 3/12/03 7:03 AM, "John Delacour" <email@hidden> wrote:
>
At 11:35 pm -0800 11/3/03, Paul Berkowitz wrote:
>
>
> Address Book OS 10.2 is too new to be documented yet. I just study the
>
> dictionary and try things. 'properties' property is in the Dictionary, so I
>
> tried it and saw a bunch of 'missing value' for properties with no value.
>
> That looked a lot more useful than stumbling around setting variables to
>
> non-existing properties, and then using the variable in a try block (I still
>
> have to do that somewhere), and so it proved.
>
>
>
> This list is where you'll find the most current information.
>
>
And here it is. It seems very long-winded to get properties like
>
that. If Address book sucks, as it does, then the last thing that's
>
needed is to make a meal of its shortcomings. The thing can be done
>
quite simply like this
>
>
tell app "Address Book"
>
set birthday to person "John Delacour"'s birth date
>
try
>
birthday
>
on error
>
set birthday to false
>
beep
>
return
>
end try
>
end tell
>
if birthday is not false then set d to "" & day of birthday
>
set m to month of birthday
>
set y to year of birthday
>
d & " " & m & ", " & y
>
--> "27 January, 1916"
No. That works fine but it's more long-winded than getting 'properties'. I
already stated that setting a variable to birthdate, then trying to access
the variable, is the other way to do it, and I find it a lot more trouble to
remember to do every single time. (Aside from the fact that you didn't
answer the question since you provided a string form for month where he
wanted a numeral). And 'properties' is extremely useful, and quick, when you
need several properties, so it should not be dismissed as you do.
In the guise of being "helpful", you invariably seem to want to turn things
into an antagonistic contest, John. I suppose I could forgive that if you
really were a cantankerous old codger of 87 but I don't believe it for a
minute. ;-) Just maybe 1961.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.