Re: Palm Desktop Script 101?
Re: Palm Desktop Script 101?
- Subject: Re: Palm Desktop Script 101?
- From: Brennan <email@hidden>
- Date: Wed, 16 Apr 2003 10:33:18 +0200
On Tue, 15 Apr 2003 17:59:12 -0400, "Michael P. Wilson"
<email@hidden> wrote:
>
Sure. My primary goal at the moment is to create a script or series of
>
scripts that merges differences between the OS X Address book and the
>
Palm Desktop using vCard as an exchange format (for export into a 3rd
>
party database for other processing.)
>
>
It seems a shame not to leverage the Palm Desktop export functionality,
>
since it will convert to vCard automatically (and presumably the import
>
will do the nice happy thing as well.) But there are two difficulties
>
I'm having with that:
>
>
1) I can't seem to get it to work. (no good examples and the dictionary
>
looks a little sparse.)
>
2) I'm guessing that the export, when scripted will actually export to
>
a file that I'd have to load back in and manage. Seems a bit
>
convoluted. But the alternative is to build the vCard myself, which I
>
REALLY don't want to do.
>
>
Any pointers?
Hi there,
Sometimes I think I'm going crazy. I could have sworn I was not able to
get 'address N' from Palm Desktop, but today it's working.
Anway, here's a little script which will export names and email addresses
from your Palm Desktop as an applescript record. You can expand it to
include other details.
on run
set all to {}
tell application "Palm Desktop"
set caddr to (count addresses)
repeat with addrInd from 1 to caddr
set firstName to first name of name info of all fields of address
addrInd
set lastName to last name of name info of all fields of address
addrInd
set thisRecord to {firstName:firstName, lastName:lastName}
set c1 to custom 1 of (all fields of address addrInd)
if c1's field title = "Email" then
set emailAddr to c1's field text
set thisRecord to thisRecord & {email:emailAddr}
end if
set all to all & {thisRecord}
end repeat
end tell
all
end run
Note, in many cases you have to flatten deep references in your code, or
they simply don't work.
For example:
set a to address 1
set af to (all fields of a) -- fails
set af to (all fields of (address 1)) -- works
set ni to (name info of af) -- fails
set ni to (name info of (all fields of (address 1))) -- works
To Chris Page: We are GAGGING for a working implementation.
Brennan
_______________________________________________
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.