Multiple attachments and entourage

Hi,

I hope I have posted to the correct area, I am using filemaker to send email through entourage but I need it to send multiple attachments unfortunately it appears filemaker doesn’t support this. I thought the best solution would be to have filemaker generate the email and then script entourage to open the attachment dialog where I can select multiple files to attach.

So far this is what I have tried (after searching here and other areas of the web):


tell application "Microsoft Entourage"
	set frontWindow to window 1
	set currentMessage to displayed message of frontWindow
	open currentMessage
	set theAttachment to choose file with prompt "Select a file to attach:" without invisibles
	make new attachment at currentMessage with properties {file:theAttachment}
end tell

The above works for attaching 1 file, but I need to be able to attach several files so tried the following:


tell application "Microsoft Entourage"
	set frontWindow to window 1
	set currentMessage to displayed message of frontWindow
	open currentMessage
	set theAttachment to choose file with multiple selections allowed
	make new attachment at currentMessage with properties {file:theAttachment}
end tell

The latter code gives the following error:
Microsoft Entourage got an error: Some data was the wrong type.

I am using entourage 2008 version 12.2.0

I hope I have given enough information, I would appreciate any advise.

Well I managed to work it out after trying a few different options and doing a little research, this is what I came up with:

-- tell application "FileMaker Pro Advanced"
	set theSubject to cell "Project" of current record
	set theMessage to cell "Message" of current record
	set theRecipient to cell "Email_Address" of current record
	set theAttachments to cell "Proofs_To_Send" of current record
	set ccRecipient to cell "Copy_To" of current record
-- end tell

set attachmentList to {}
repeat with i in paragraphs of theAttachments
	set theAttachment to i
	set aliasAttachment to theAttachment as alias
	set attachmentList to attachmentList & aliasAttachment
end repeat

tell application "Microsoft Entourage"
	launch
	activate
	set theRecipients to {{address:{address:theRecipient}, recipient type:to recipient}, {address:{address:ccRecipient}, recipient type:cc recipient}}
	set newMessage to make new outgoing message with properties {recipient:theRecipients, subject:theSubject, content:theMessage}
	open newMessage
		tell newMessage
			repeat with i in attachmentList
				make new attachment at newMessage with properties {file:i} 
			end repeat
		end tell
end tell