Jump to content

Link FM7 to emails


This topic is 6598 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Is there any practical way to link all my emails for various clients to their FM record in my database? I really don't want to see all the text, but if it were possible to see the subject name and date of the email it would cut down on my search time.

Link to comment
Share on other sites

There would be ways to do this, using AppleScript. Or you could just receive their emails directly into FileMaker, using an email plug-in (though you'd want to do this via a dedicated email account address, so they didn't get mixed up with your other mail). Whether it's practical is subjective.

It depends on which email program you use how exactly the AppleScript would look, though it would similar in all. Because I neither use Mail, nor link emails to records in FileMaker (I don't have that many clients, unfortunately), I have a few examples I've either gathered or written.

I also don't know how you organize your client emails. If you have many emails from each client, each client would likely have their own mailbox.

It seems as if the most efficient method would be to create a "rule" in Mail which ran an AppleScript on each of the client emails, moving them to their own folder, and also creating a record in a FileMaker database. But that would mean that the database would have to either be open, or be opened at that time. It would also need to know whether the email was a "client" email. Maybe it could read from a list; I don't really know the rules :-]

Or you could run something on the current message from the Scripts menu (which I've heard Stevie boy has removed from Tiger Mail?, and is only available via the system-wide Scripts menu; which is OK, but not as convenient).

Sorry to be so vague, but synchronization is always a problem.

Anyway, here is a script in the format for a rule to run, to create a FileMaker record. It gets the content also, but you could remove that:

using terms from application "Mail"

on perform mail action with messages theseMails

repeat with thisMail in theseMails

tell thisMail

set the_sender to get sender

set the_subject to get subject

set the_body to get content

end tell

tell application "FileMaker Developer"


create new record at end of table "a table" of database "test.fp7"

set cell "The_sender" of last record of database "test.fp7" to the_sender

set cell "the_subject" of last record of database "test.fp7" to the_subject

set cell "the_body" of last record of database "test.fp7" to the_body

end tell

set read status of thisMail to true

end repeat

end perform mail action with messages

end using terms from

Alternatively you could just search the emails in Mail for something. I imagine Spotlight could do this, but neither of us are using Tiger yet. If the clients have their own mailbox, and you want to search for a specific subject. The following has hard-coded values to look for, as well as an Account. But it would be easy enough to set them to FileMaker fields. It will open a separate Mail window for each message found; so you'd want to keep the search pretty focused. Alternatively you could return results, such as Subjects, to a FileMaker table (portal), then pick them one at a time to view "contents".

set theSender to "Apple"

set theSubject to "Invoice"

set theText to "6196921529"

tell application "Mail"

set theAccounts to every account

set theMailbox to mailbox "INBOX" of account 2

set allMessages to every message of theMailbox whose sender contains theSender and (subject contains theSubject or content contains theText)

if allMessages is not {} then

repeat with aMessage in allMessages

open aMessage


end repeat

end if

end tell

Edited by Guest
Link to comment
Share on other sites


try the outlook manipulator plugin by productive computing. we have our emails coming into our internal system (run in FM). the from email address in the email is used to link with the email addresses in the clients file/table to retrieve further relevant information (phone number, etc.). it works well.


Link to comment
Share on other sites

  • 2 months later...

I t has been a while since anyone has responded here. I downloaded Outlook Manipulator, but, it is not exactly what I was looking for. I want to track email history and display the data in a portal. So, when I send an email it relates to the contact record and tells me when and what email was sent. So, the portal should have the Date, Subject, and a link to the message. I set up an "Email Activities" table with fields:

Message_ID {Number}

eMail_ID {Number}

Contact_ID {Number} - Related to Contacts

eMail_Address {Text}

Subject {Text}

Message {Container} Calculated to populate the field based on a lookup from subject.

I've got a script that will open a new record and paste the Contact_ID and eMail_Address into the proper fields. The problem is how do I get the subject and message both into the "Send eMail" script and into the eMail Activities record? Has anyone done anything similar to this?

Link to comment
Share on other sites

This topic is 6598 days old. Please don't post here. Open a new topic instead.

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
  • Create New...

Important Information

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