• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Get sender in Apple Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get sender in Apple Mail


  • Subject: Re: Get sender in Apple Mail
  • From: Joe <email@hidden>
  • Date: Fri, 29 Aug 2008 15:34:50 -0700

At 11:03 PM +0100 8/29/08, Martin wrote:
>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.

I don't think doing this with GUI scripting is the way to go. Mail has a very good AppleScript dictionary. You have many good examples of scripting Mail on your machine. Look in here for examples:

Macintosh HD:Library:Scripts:Mail Scripts:

Check out "Crazy Message Text" to start.

Search the list archives for "mail reply" The link is at the bottom of every list message.

Open Mail's dictionary with Script Editor and check that out too.

HTH
Joe
 _______________________________________________
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

  • Follow-Ups:
    • Re: Get sender in Apple Mail
      • From: Martin <email@hidden>
References: 
 >Get sender in Apple Mail (From: Martin <email@hidden>)

  • Prev by Date: Get sender in Apple Mail
  • Next by Date: Re: Get sender in Apple Mail
  • Previous by thread: Get sender in Apple Mail
  • Next by thread: Re: Get sender in Apple Mail
  • Index(es):
    • Date
    • Thread