Re: Get sender in Apple Mail
Re: Get sender in Apple Mail
- Subject: Re: Get sender in Apple Mail
- From: Ed Stockly <email@hidden>
- Date: Fri, 29 Aug 2008 16:59:59 -0700
As this is my first post to this list I'd better introduce myself.
Welcome aboard, Martin!
I understand how to to access the library for a specific
application but I don't really understand the terms such as
"class", "object" etc. and I can't find a tutorial that starts from
basics.
"Class" refers to objects of a specific type. For example, in mail
"message" is one of a large number of classes.
An individual message my be considered an object, that falls into the
class "message"
A message can have various properties and elements, some are
required, some optional.
For example the sender is a property of a message.
Does anyone know how to get the original message sender's name and
paste it in?
I'd also like to know how to paste in the name, subject line and
other parameters.
-------
tell application "Mail"
tell message viewer 1
tell message 1
set senderName to sender as text
set msgSubject to subject as text
end tell
end tell
set myText to senderName & " wrote..." & return & myText
set thisMessage to make new outgoing message at end of outgoing
messages with properties {content:myText, subject:"RE: " &
msgSubject, visible:true}
end tell
-------
The above may be enough to get your started. Keep in mind that that
last command that begins "set thisMessage..." should all be on the
same line. This example, by the way, is based on the samples that Joe
mentioned that are installed on every mac.
HTH
ES
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden