setting the sender in Microsoft Entourage apple script

I made the following script that works. However I want to also set the sender so it is not the same as the default account in ME, lets say I want to set it to “us@my-account.com”. but I do not know how to do this. can anybody help me?

tell application "Microsoft Entourage"
	make new outgoing message with properties {recipient:"me@my-account.com", subject:"test message", content:"the body"}
	set messID to the result
	send messID
end tell

thanks

Hi,

the dictionary says

Message
message (noun), pl messages: An e-mail message

Properties
Property access Type Description
.
sender get/set address sender of the message
.

Address
address (noun), pl addresses: An e-mail message address

Properties
Property access Type Description
.
address get/set string the e-mail address
display name get/set unicode text the name used for display

according the dictionary this might be the right syntax


set sender to {address:"john@doe.com", display name:"John Doe"}

Thanks

Yes I tried that too before posting.

see if I try this

tell application "Microsoft Entourage"
	make new outgoing message with properties {recipient:"me@my-account.com", subject:"test message", content:"the body"}
	set sender to {address:"john@doe.com", display name:"John Doe"}
	set messID to the result
	send messID
end tell

I get

i also tried:

set theSubject to "Some Subject"
set theBody to "Some Body"
set thesender to {address:"john@doe.com", displayname:"John Doe"}
tell application "Microsoft Entourage"
	set theMessage to make new outgoing message with properties {subject:theSubject, content:theBody, sender:thesender}
	open theMessage
end tell

and that creates a massage but does not change the sender.

I also note that it does not capitalize the sender in - sender:thesender-. not sure what that means though.

You have to consider the references.
As you can see in the dictionary excerpt above, sender is a property of message, not of application
Try something like this

tell application "Microsoft Entourage"
	set theMessage to make new outgoing message with properties {recipient:"me@my-account.com", subject:"test message", content:"the body"}
	tell theMessage
		set sender to {address:"john@doe.com", display name:"John Doe"}
		send
	end tell
end tell

Thanks Stefan, learning all the time.

That works better, it now does takes “John Doe” but not “john@doe.com”, here it still takes the default account, not sure how to fix this.