MACSCRPT Archives

January 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Joe Barwell <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 18 Jan 2007 17:00:01 +1300
Content-Type:
text/plain
Parts/Attachments:
text/plain (46 lines)
> "cc recipient" is listed in the dictionary for mail as an
> element of  a message.  What I can't figure out is how to
> identify the message.  In Eudora
>
> set foo to make new message at end of mailbox "Out"
> set field [whatever] of foo to [whatever]
>
> But that doesn't work in Mail.

Hello Bill,

Try something along the lines of the following:

set contentsString to "Contents"
set subjectString to "Subject"
set senderString to "Some Person <[log in to unmask]>"
set addressString to "[log in to unmask]"
set nameString to "Some Person"


tell application "Mail"
	set newMsg to make new outgoing message with properties
{contents:
contentsString, subject:subjectString, sender:senderString,
visible:true}
	tell newMsg
		make new to recipient at end of to recipients with
properties
{address:addressString, name:nameString}
		make new cc recipient at end of cc recipients with
properties
{address:addressString, name:nameString}
	end tell
end tell


I strung the above together (but _not_ fully tested, as I
can't send emails out of
Mail here at work) after finding the following:
<http://developer.apple.com/
qa/qa2001/qa1018.html>

Cheers!

Joe

ATOM RSS1 RSS2