Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Control which email address is used by FileMaker Apps
Some time ago, FileMaker added an emailing Scriptmaker step, which eliminated the need to use Applescript to send mail from the program. I was setting up a large script that would take the contents of several fields and mail them to someone as part of the macro. FileMaker is smart enough to send via Mail without having to bring it to the forefront. But I noticed while testing the script that it wasn't using the email address I thought it would to send.

I have a few different email addresses, one for work, one for home, etc., that all forward to the same POP box. I used a previous tip here to set up Mail to allow me to use my various email addresses via one "account" (since it's all the same box). I had assumed that Filemaker would pull the first email address in my preferences for the "To" field, as the tool doesn't include a way to specify that field. A dozen tests of changing various Mail preferences and poking around FileMaker, though, and it was still sending with the wrong email address.

I eventually realized that FileMaker was pulling my email address from my Address Book card -- the one that I had chosen with Card -> Make This My Card menu item. And it seemed to select the first email listing on that card, which was my personal address. Now I've created a few cards, each with a single email address, and if I need to use the script for a different purpose, I change the card using the Card -> Make This My Card menu option in Address Book before using the tool in FileMaker.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[4,521 views]  

Control which email address is used by FileMaker | 1 comments | Create New Account
Click here to return to the 'Control which email address is used by FileMaker' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Control which email address is used by FileMaker
Authored by: jporten on Aug 16, '04 03:09:05PM

If you need greater control over sending mail than what's available in FMP scripting, there's always AppleScript. You can target a new message from any account, and drive it with data in FMP fields.

My procedure for doing this:

1) write a working script in Script Editor

2) paste script into BBEdit

3) in order, replace " with \"; replace \r with ¶"\r"; add a quote at the beginning and end of the file. (All of these quotes are literals; type quotes where you see them. The semicolons are grammatical, do not type them. You're escaping the existing quotes, and adding CRs and quotes at every line break. ¶ is option-7. If you're using FMP <7, use "" instead of \" .)

4) paste the result into a calculated global.

5) edit in the FMP fields as necessary. Be sure to wrap FMP fields in \" & [field] & \" .

Works like a charm; lets you debug the script first, then translate it programmatically for FMP usage.



[ Reply to This | # ]