Jump to content
Sign in to follow this  
A Fuller

Exporting email data to Address Book (OS X)

Recommended Posts

I need to export a group of email addresses from Filemaker 5.5 database and eventually get them into Address Book (OS X) as a "group." Any suggestions? Filemaker doesn't support LDIF or vCard when exporting. Before upgrading to OS X/Mail/Address Book, we would export as comma delimited and then import into Entourage quite easily.

Share this post


Link to post
Share on other sites

I am not a fan of MS Office, but in this case it is what you need. Get a copy of Entourage. (Even a free trial will do.) Export your FMP data to a tab, or coma-delimited file. Microsoft likes to think it is a universal program and wants to import from as many different sources as possible. Entourage should be able to import this data. Once imported, drag your data to a folder on your desktop. This will automatically convert it into vCard form. Then import your vCards into your OSX Address Book. Got this from our local MUG guru. I have yet to try it, but am assured of success. Good luck.

Share this post


Link to post
Share on other sites

Another possible route is AppleScript. The following should (with minor modifications) export FileMaker records to Address Book.

Put in a Perform AppleScript script step. This is going to do the found set (window 1). It is NOT checking for duplicates.

It hasn't been extensively tested, as I've been working on an iCal synchronization script. You can copy/paste it into Script Editor, then uncomment the 1st and last lines and compile to see it properly indented and colored (prettier :o-)

("is not" was the "not equals" sign; but the web doesn't like it)

--tell application "FileMaker Developer"

--comment above and last "end tell" in a Perform AppleScript step in FileMaker (not needed)

tell window 1

set recCount to count records

set theCounter to 1

go to record 1

repeat recCount times

go to record theCounter

tell current record

set firstName to cell "FirstName" as Unicode text

set lastName to cell "LastName" as Unicode text

set firstLast to cell "FirstLast" as Unicode text

set theStreet to cell "Street" as Unicode text

set theCity to cell "City" as Unicode text

set theState to cell "State" as Unicode text

set theZip to cell "Zip" as Unicode text

set theCountry to cell "Country" as Unicode text

set Email_home to cell "Email_Home" as Unicode text

set Email_work to cell "Email_Work" as Unicode text

set phone_home to cell "Phone_Home" as Unicode text

set phone_work to cell "Phone_Work" as Unicode text

end tell

tell application "Address Book"

set thePerson to make new person

set (group of thePerson) to "All"

set (first name of thePerson) to firstName

set (last name of thePerson) to lastName

set theAddress to make new address at end of thePerson

set (label of theAddress) to "Home"

set (street of theAddress) to theStreet

set (city of theAddress) to theCity

if theState = "" then

set (state of theAddress) to "CA"

else

set (state of theAddress) to theState

end if

set (zip of theAddress) to theZip

if theCountry = "" then

set (country of theAddress) to "USA"

else

set (country of theAddress) to theCountry

end if

if Email_home is not "" then

set theEmail to make new email at end of thePerson

set label of theEmail to "Home"

set value of theEmail to Email_home

end if

if Email_work is not "" then

set theEmail to make new email at end of thePerson

set label of theEmail to "Work"

set value of theEmail to Email_work

end if

if phone_home is not "" then

set thePhone to make new phone at end of thePerson

set label of thePhone to "Home"

set value of thePhone to phone_home

end if

if phone_work is not "" then

set thePhone to make new phone at end of thePerson

set label of thePhone to "Work"

set value of thePhone to phone_work

end if

end tell

set theCounter to theCounter + 1

end repeat

end tell

--end tell

Share this post


Link to post
Share on other sites

Pardon me for asking, but I don't have much experience with AppleScript and you seem to be great at it. Do you know of a way to import the metadata from a Photoshop photo into a FMP database?

Whatever information you can provide would be most appreciated.

Thank you very much.

Share this post


Link to post
Share on other sites

Well, I don't have Photoshop, nor do I have a digital camera. I'm a "just give me the data, ma'am" kind of guy :o-)

Photoshop has its own AppleScript dictionary. But everyone on modern Macs has an hidden application named Image Events, which AppleScript can use.

[Attached is my own handy-dandy "Image Info" AppleScript droplet. Either drop an image file on it, or double-click it. It's editable also.]

Copy this and run in Script Editor, and you'll see that the info is available:

tell application "Image Events"

set theImage to open theFile

set theMeta to metadata tags of theImage

-- set theSpace to value of metadata tag "space" of theImage

--set theSpace to color space of theImage

close theFile

return theMeta

end tell

The --commented lines are how you'd ask for one of those bits of info. One way is via the metadata tag. The other is directly (see below).

Open the AppleScript dictionary for Image Events, and you'll see the following info is available directly:

Class image: An image contained in a file

Plural form:

images

Elements:

metadata tag by name, by numeric index, before/after another element, as a range of elements, satisfying a test

Properties:

<Inheritance> item [r/o] -- All of the properties of the superclass.

color space Eight channel/Eight color/Five channel/Five color/Seven channel/RGB/Lab/XYZ/Six channel/CMYK/Six color/Seven color/Named/Gray [r/o] -- color space of the image's color representation

resolution list [r/o] -- the pixel density of the image, in dots per inch, as a pair of integers

bit depth sixteen colors/color/four grays/black & white/thousands of colors/grayscale/two hundred fifty six grays/four colors/sixteen grays/millions of colors/best/two hundred fifty six colors/millions of colors plus [r/o] -- bit depth of the image's color representation

name Unicode text [r/o] -- the name of the image

dimensions list [r/o] -- the width and height of the image, respectively, in pixels, as a pair of integers

image file file [r/o] -- the file that contains the image

file type PICT/Photoshop/BMP/QuickTime Image/GIF/JPEG/MacPaint/JPEG2/SGI/PSD/TGA/Text/PDF/PNG/TIFF [r/o] -- file type of the image's file

location disk item [r/o] -- the file location of the image

ImageInfo.zip

Share this post


Link to post
Share on other sites

-- You need all the fields on the current FileMaker layout. iCal Status is tricky, doesn't like text; that's why the subroutine.

property calTitle ??? "Home"

global theCalendar

global theEvent

global theStatus

global theAttendee

tell application "FileMaker Pro"

tell current record of document "FM_to_iCal.fp7"

set dateStartTxt to cell "_cTimeStampStart"

set dateEndTxt to cell "_cTimeStampEnd"

--The above must be TimeStamp fields; construct from Date & Time fields

set theSummary to cell "EventName"

set theStatus to cell "Status"

set theLocation to cell "Location"

set theAttendee to cell "Client"

set theEmail to cell "Email"

set theCalendar to cell "CalendarName"

end tell

end tell

set DateStart to date dateStartTxt

set DateEnd to date dateEndTxt

tell application "iCal"

set theCalendar to item 1 of (every calendar whose title is calTitle)

tell theCalendar

set theEvent to make new event at end of events

tell theEvent

set start date to DateStart

set end date to DateEnd

set summary to theSummary

set location to theLocation

set allday event to false

my set_status(theStatus)

if theAttendee is not "" then

try

make new attendee at beginning of attendees with properties {display name:theAttendee, email:theEmail}

end try

end if

end tell

end tell

end tell

on set_status(theStatus)

tell application "iCal"

tell theCalendar

tell theEvent

if theStatus is "None" then

set status to none

else

if theStatus is "Tentative" then

set status to tentative

else

if theStatus is "Confirmed" then

set status to confirmed

else

if theStatus is "Cancelled" then

set status to cancelled

end if

end if

end if

end if

end tell

end tell

end tell

end set_status

Share this post


Link to post
Share on other sites

That is way too complex for me. I just want to export some birthdays and anniversaries to iCal on an occasional basis...

Thanks so much for posting it, though. I am sure someone else will love it!

Share this post


Link to post
Share on other sites

I am in the same situation as "A Fuller" and I tried this method of importing my FM data into Entourage. Then I tried to export the date to a desktop folder, which didn't work as an import file to Address Book. So I tried to locate a Contacts data file by searching the Entourage folder and my Users folder. One-by-one I relocated many "possible" data files to a desktop folder, and then used Address Book to import, but none of the files worked. What am I doing wrong? Any guesses?

Share this post


Link to post
Share on other sites

Thanks for the Applescript!

I posted to another forum, but this seems like a better location. I did build the FileMaker applet using a Troi plug-in. You can see it here http://tapsuccess.com

However, now I have another problem. Somehow the keywords are changed froma comma separated text file to a vertical list with one keyword per line and a "hard return" after each word. This presents a problem because now each word gets its own field.

Would you know what is happening?

Best regards, and thanks again for the Applescript.

Share this post


Link to post
Share on other sites

Thanks for the Applescript!

I posted to another forum, but this seems like a better location. I did build the FileMaker applet using a Troi plug-in. You can see it here http://tapsuccess.com

However, now I have another problem. Somehow the keywords are changed froma comma separated text file to a vertical list with one keyword per line and a "hard return" after each word. This presents a problem because now each word gets its own field.

Would you know what is happening?

Best regards, and thanks again for the Applescript.

Share this post


Link to post
Share on other sites

Thanks for the Applescript!

I posted to another forum, but this seems like a better location. I did build the FileMaker applet using a Troi plug-in. You can see it here http://tapsuccess.com

However, now I have another problem. Somehow the keywords are changed froma comma separated text file to a vertical list with one keyword per line and a "hard return" after each word. This presents a problem because now each word gets its own field.

Would you know what is happening?

Best regards, and thanks again for the Applescript.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.