Re: Importing address book from Eudora 3.1
Re: Importing address book from Eudora 3.1
- Subject: Re: Importing address book from Eudora 3.1
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 17 Sep 2002 07:10:13 -0700
On 9/17/02 5:50 AM, "Emmanuel" <email@hidden> wrote:
>
I needed to export my address book from Eudora 3.1 into OS X' Address
>
Book. Thanks to kind listees I was made aware that some importation
>
scripts are located in Library/Scripts/Mail Scripts. After having used
>
them, here are two remarks for whom it may concern:
>
- on my machine, the script would not compile. I had to add one pair of
>
parentheses.
>
- on my machine, the script imported only partially some of the
>
records. Namely, it produced several records with "<No Name>" as the
>
name, no nickname, nothing except the e-mail (when the original records
>
contained at least a nickname). Why it has done so is not obvious to me
>
at first sight. So, I wrote a script which searches for those records
>
of Address Book with an empty name and corrects them according to the
>
information contained in the Eudora Nicknames file. I am storing this
>
script since colleagues will need it sooner or later. In case you need
>
it just ask me.
>
Here's something in Address Book scripting which is extremely strange and
might be related. In any case it's something to watch out for:
If a particular property - say, organization - has not been filled out for a
person, it simply doesn't exist, and trying to get it will error. However,
if you first get the 'properties' property (a record) of that person, which
is more efficient as it involves only one AppleEvent, then organization will
be 'missing value'. So you can work around that possibility.
But in the case of a person that doesn't exist
get person "Joe Blow"
it does _NOT_ error. So this construction:
try
set thePerson to person theName -- no error if doesn't exist
on error
--do something
end try
will not catch it. If you are debugging, you will think you are doing OK.
But you're not : it will error instead at the _next_ statement that tries to
use the variable, which might not be for a while. This can be very
confusing. So you need to do something like this:
try
set thePerson to person theName
get thePerson -- ERROR: The variable thePerson is not defined
on error
--do something
end try
This is a really shoddy implementation, where you can set a variable to
something that doesn't exist, without error. The same applies to any element
by name, whereas searching for
first [element] whose name is theName
will error as expected if the element doesn't exist. However it is
impractical to have to search the entire database this way for a missing
person: the try/get method above is much faster.
--
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.