How do I get TO Recipients in Entourage?

I am trying to create a script that will act on the current message in my Sent Items folder. I want to get a list of all the receipts in the TO field.


	set SelectedMessages to current messages
	set theMessage to item 1 of SelectedMessages
	set theRecipients to every recipient of theMessage

The problem is that this gets ALL the recipients, including the CC and BCC recipients. How can I extract just the TO recipients and ignore the CC and BCC recipients?

P.S. I have searched the forums and can’t find anything. I apologize if this has been answered elsewhere.

Model: MacBook Pro
AppleScript: 1.10.7
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

Hi Michael,

try

tell application "Microsoft Entourage"
	set SelectedMessages to current messages
	set theMessage to item 1 of SelectedMessages
	set theRecipients to every recipient of theMessage whose recipient type is to recipient
end tell

Stefan,

Thank you so much. This is much cleaner than the way way I was attempting to do it!

Mike

P.S. I have a daughter whose has been in Switzerland for the last six months. She is studying in Huemoz.