Entourage: getting sender for Rule

I’m just trying get to first base in Entourage. Ultimately I want to “Run Applescript” as a rule in Entourage that will do something in Filemaker and send back results to the sender of the email that invokes the Rule.

But my efforts to understand how to address a message first so that I can learn how to invoke the Rule shows my lack of understanding of the basics.

I’ve found “sender” in the dictionary and have adapted El’s post from the Forum as shown below. But I’m not getting anything about the current message.

Help me first to get to how to address the current message:


tell application "Microsoft Entourage"
	--get properties of window 1
	--set tipper to sender of message 1
	set addresssender to address of sender of current messages
	
end tell

thanx, sam

Browser: Safari 419.3
Operating System: Mac OS X (10.4)

This is how I do it

tell application "Microsoft Entourage"
	
	set messages_ to the current messages -- you can use selection also
	repeat with i from 1 to number of items in messages_
		set theMsg to item i of messages_
		set addr to address of sender of theMsg
	end repeat
	
end tell

Thank you, I’m not sure what’s different other than the repeat loop, but this does work, thank you. :slight_smile:

The results from selection or current messages are in list form.
So you have to call the items of the result.

The repeat just makes it easier than say:

tell application "Microsoft Entourage"
	set theMsg to selection -- or use current messages
	set addresssender to address of sender of item 1 of theMsg
end tell

or

tell application "Microsoft Entourage"
	set theMsg to selection 
	set addresssender to {address of sender of item 1 of theMsg, address of sender of item 2 of theMsg}
	
end tell

or

tell application "Microsoft Entourage"
	set addresssender to address of sender of item 1 of (selection as list)
end tell