Get sender in Apple Mail
Get sender in Apple Mail
- Subject: Get sender in Apple Mail
- From: Martin <email@hidden>
- Date: Fri, 29 Aug 2008 23:03:13 +0100
As this is my first post to this list I'd better introduce myself.
I'm 57, run my own on-line mail-order business (since 1995) and have
used Macs since 1987.
So I'm not a newbie to Macs but I know almost nothing about
AppleScript (sorry).
I live in Cheshire, England with my family.
I have modified several example scripts to suit my purposes but now
I'm stuck!
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.
I have bought "AppleScript The Definitive Guide (v2)" from O'Reilly
and I'm gradually working my way through but it gives very few Apple
Mail examples and that's what interests me right now.
I've been playing with a "bottom posting" script, kindly supplied by
John Gruber. It generates a reply to an email by quoting the selected
text and placing the cursor below. I modified it slightly so that it
deletes the top line "On 25 Aug 2008, at 9:49, John Doe wrote:" and
replaces it with text. However, I can't figure out how to put the
sender's name after my new text. Here's the script so far:-
tell application "Mail" to activate
tell application "System Events"
tell process "Mail"
tell menu bar 1
click menu bar item "Message"'s menu
"Message"'s ¬
menu item "Reply"
end tell
delay 0.5
key code 117 -- Forward Delete blank line at top
keystroke "k" using control down -- delete "John Doe
wrote" line
keystroke "Here is some text from " -- (I want
sender's name here)
key code 125 using command down -- cmd+down arrow -
put cursor at bottom
key code 36 -- Return
end tell
end tell
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.
(This is purely a learning exercise for me but I'd be grateful for
any pointers.)
Martin
_______________________________________________
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