FileMaker, Entourage, AppleScript and a BCC List

Hi All,

I have been able to set a recipient list in Entourage 2004 referencing a field in FileMaker (Advanced 8.5). Now, I want to set the bcc list and have successfully tested it with text rather than as a variable, but when I reference the FileMaker field the information turns out blank using the same script I used for the recipient list that worked!

Here’s an example of the script I’m using (interchanging recipient (working) for BCC recipients (not working) when
needed):

tell application “FileMaker Pro Advanced”

set r to {"something", "item 2", "3rd item", "replace me"}

set AppleScript's text item delimiters to {","}
set bcclist to (field "contact_email" of layout "Form View Campaigns")
set AppleScript's text item delimiters to {""}
set item 4 of r to bcclist

end tell

tell application “Microsoft Entourage”

set newMsg to make new draft window with properties {BCC recipients:bcclist}

end tell

That just opens up a blank new message. However, when I set the recipient to bccList it works fine.
Can anyone tell me what I am doing wrong and how I can get my bcc list to work properly?

Thanks

toronyc

for some reason its expects it to be a string so run it like this


tell application "FileMaker Pro Advanced"
	
	set r to {"something", "item 2", "3rd item", "replace me"}
	
	set TID to AppleScript's text item delimiters
	set AppleScript's text item delimiters to {","}
	set bcclist to (field "contact_email" of layout "Form View Campaigns")
	set item 4 of r to bcclist
	
end tell


tell application "Microsoft Entourage"
	
	set newMsg to make new draft window with properties {BCC recipients:(bcclist as string)}
	
end tell

set AppleScript's text item delimiters to TID

that should do the trick

mm

edit: I fixed the tids

It worked - thanks!!

Your welcome :slight_smile:

Oops - how do I test for valid cell information? When there is a field which has no information, it creates a problem in the string (putting “<>” around the addresses which follow). I guess I could control that on the FM side, but I’d like to see if I could do it through AppleScript instead.

I can’t replicate that problem but what you will have to do is loop through the bcclist checking each one and reubuilding the list as you go