Scripting New Group Contacts from Database

B

blister57

Hi-

I use Entourage 2004 (11.2.1) at work. We are connected to an Exchange
Server. In this setup personal groups are kept inside my local address
book folder. My Mac users need a way to share Entourage group lists
that's free. So I thought I'd take on the challenge.

I have been working on a way to export groups with AppleScript and to
place them into a FileMaker Pro database. I got that export part down
good. The issue I'm having is sending a group back from the database
to Entourage.

Here is my script that writes a group entry back to Entourage from
FileMaker Pro...

tell application "FileMaker Developer"
set thedb to "entourage group manager"
set dialog1 to display dialog "Are you sure you want to add this group
to your address book?" buttons {"Yes", "No"} default button "No" with
icon 1 giving up after 20
if button returned of dialog1 = "Yes" then
set myid to cell "ID" of current record of window thedb
set mygroupnm to cell "group" of current record of window thedb
show layout "table" of window thedb
do script FileMaker script "show all" of window thedb
show (every record of window thedb whose cell "ID" = myid)
set thiscount to count of records of window thedb
tell application "Microsoft Entourage"
set mygroup to make new group at folder "address book"
set name of mygroup to mygroupnm
end tell
repeat with i from 1 to thiscount
set mydata to cell "address" of record i of window thedb
tell application "Microsoft Entourage"
make new group entry of mygroup with properties {display
name:mydata, address:mydata}
end tell
end repeat
else
end if
end tell

In the script statement - "make new group entry of mygroup with
properties {display name:mydata, address:mydata}"... I have to use the
email address information in both display name and address properties
for the email address to "stick".

If I use the actual name( ex. John Brown) for display name and the
actual email address, then the display name will be written for both
the display name and email address of the new group entry. (ex. John
Brown <John Brown>)

I'm missing something, but I can't put my finger on it.

I've tried -- "make new group entry of mygroup with properties
{contents:{display name:mydata, address:mydata}}"

Entourage tells me there was an error and some data was the wrong type.


So I start looking in the Entourage AppleScript dicitonary and see that
the display name is unicode and that the email address is a string.

Coercing text to unicode and the email address as a strign did not fix
it either.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top