Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Change Mail behavior when replying to a message in the Sent mailbox Apps
When using Gmail (I don't know if this is the case with other webmail providers), if you reply to a message in your Sent mailbox, the recipient of the reply message is set to the recipient of the original message you sent. That makes sense, it's useful for quickly replying to a message you've just sent when you realize you've forgotten something (like an attachment).

However, Apple Mail doesn't work that way; if you reply to a message in your Sent mailbox, you (the sender of the original message) become the recipient of the reply message (which is pretty useless in my opinion).

If you choose Reply all instead of Reply, it's a little better: you are still the 'To' recipient of the reply message, but the recipients of the original message are added as Cc: recipients of the reply message.

I used this fact to create an AppleScript that when invoked creates a reply to the selected message in the Sent mailbox in Mail, with the recipients of the original message as 'To' recipients of the reply message and no Cc: recipient, thus restoring Gmail's behavior in Mail.

Here is the script:
tell application "Mail"
  activate
  set theMessages to the selected messages of the front message viewer
  
  (*the script is intended to work on only one message but if "selection" is used instead of "selected items" along with "first item of" on the next line, nothing happens (no message appears). I think it's a bug in the reply command. (A little Google search shows you this command has a buggy past...) *)
  
  set theMessage to first item of theMessages
  set outgoingReplyMessage to (reply theMessage with opening window and reply to all)
  
  (*"reply to all" is always used in order to get the recipients of the original message in the Cc field (as I said above, if it's not used, the original recipients are not used anywhere). They are switched to the To field later on. *)
  
  set theIntendedRecipientsAdresses to (get address of every cc recipient of outgoingReplyMessage)
  set quoted to quote original message
  if quoted is true then
    set quote original message to false
    
    (*this is to prevent the cited text of the original message to appear a large number of time in the reply message (in my tests, it was copied at least 27 times). I think this is another bug... *)
    
  end if
  repeat with theIntendedRecipientAddress in theIntendedRecipientsAdresses
    
    (*this is the real work : each cc recipient is copied to the To recipient field. *)
    
    tell outgoingReplyMessage
      set theIntendedRecipient to make new to recipient at the end of to recipients
      set address of theIntendedRecipient to theIntendedRecipientAddress
    end tell
  end repeat
  set address of first to recipient of outgoingReplyMessage to ""
  
  --deletes you (the sender) from the list of To recipients
  
  set address of cc recipient of outgoingReplyMessage to ""
  
  --deletes every Cc recipients
  
  if quoted is true then
    set quote original message to true
  end if
end tell
For ease of use, I copied that script into a 'Run Applescript' Automator action (receive no input, in application Mail) and saved it as a Service (10.6 only). I then assigned a keyboard shortcut for it using the Keyboard preference pane of System Preference (Under the Keyboard Shortcut tab, then choosing Services on the left). Command+Option+Shift+R and Command+Control+Option+R are both available in Mail.

Of course, you can also use it with your favorite shortcut application, be it Quicksilver, Butler, Alfred, Keyboard Maestro, etc. Just save it as a Script instead (.scpt).

Be warned that this script is only intended to be used in the Sent mailbox; using it on a message in your Inbox won't work (and could lead to errors.) What's more, there is no error detection to verify it is used in the Sent mailbox.

[crarko adds: I tested this, and it works as described. A very useful script.]
    •    
  • Currently 2.90 / 5
  You rated: 2 / 5 (10 votes cast)
 
[6,172 views]  

Change Mail behavior when replying to a message in the Sent mailbox | 12 comments | Create New Account
Click here to return to the 'Change Mail behavior when replying to a message in the Sent mailbox' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Change Mail behavior when replying to a message in the Sent mailbox
Authored by: earthsaver on Jun 09, '11 07:52:54AM

Easier than this is to use the free MailFollowup plugin, which tends to get updated quite quickly after each OS/Mail.app update.

---
- Ben Rosenthal
MacBook Pro 2.8GHz - Snow Leopard
iPad 3G 32GB



[ Reply to This | # ]
Change Mail behavior when replying to a message in the Sent mailbox
Authored by: CVBruce on Jun 09, '11 08:35:14AM

Maybe I don't understand the problem, but why don't you just use Message->Send Again.

I don't understand why you think reply should do anything but reply to the sender, which in your case is yourself.

Bruce



[ Reply to This | # ]
Change Mail behavior when replying to a message in the Sent mailbox
Authored by: zpjet on Jun 09, '11 03:06:07PM

Yep. This is the right way to do it.

Cmd-Shift-D. And if you push it twice, it will send it.



[ Reply to This | # ]
Change Mail behavior when replying to a message in the Sent mailbox
Authored by: auntchilada on Jun 09, '11 03:31:53PM

right on, Bruce. bollox to this hint and those who spend inordinate effort when the correct solution has been thought of and implemented by the engineers.

scan the menubars, people!



[ Reply to This | # ]
Change Mail behavior when replying to a message in the Sent mailbox
Authored by: postglock on Jun 09, '11 05:07:29PM

Send again is slightly different, as it works as far as recipients are concerned, but doesn't indent the quote levels by one (which can be manually indented after selecting all via Format > Quote Level > Increase).



[ Reply to This | # ]
Change Mail behavior when replying to a message in the Sent mailbox
Authored by: jaydisc on Jun 09, '11 06:27:36PM

Because you want what you wrote to be part of the reply string, e.g.

"Did your receive this? Why haven't you called?

On this date, you <yourself> wrote:

Hey! Call me"

Send Again does not accomplish this. Lion fixes it anyway.



[ Reply to This | # ]
Change Mail behavior when replying to a message in the Sent mailbox
Authored by: zpjet on Jun 11, '11 09:29:10PM

Lion "fixes" it? I don't see it broken. I hope it will be optional. Because I use Send Again all the time - to do what it says. To send the very same email again (to someone else, for example).



[ Reply to This | # ]
Change Mail behavior when replying to a message in the Sent mailbox
Authored by: jaydisc on Jun 11, '11 10:21:53PM

You don't see it as broken because you don't use or understand it. Send Again still works for your purposes.



[ Reply to This | # ]
Change Mail behavior when replying to a message in the Sent mailbox
Authored by: glusk on Jun 09, '11 10:04:33AM

Nice script. I usually like to reply to myself instead of send again to make it clear that it's a new additional thought and not a mistake. This script does the things I've been doing by hand. Thanks!
I also have a smart mailbox in mail.app that includes Sent and Inbox to incorporate my own messages in the the threads. Wish iOS would do this.



[ Reply to This | # ]
Change Mail behavior when replying to a message in the Sent mailbox
Authored by: howiedi2 on Jun 09, '11 03:10:05PM

Why not just use the send again command (Shift-Command-D)? It re-sends the original message, keeping the original recipients intact, and allows you to append the message with extra text, and include an attachment. No need to overcomplicate this with a script.



[ Reply to This | # ]
MailFollowup plugin
Authored by: rgray on Jun 13, '11 04:24:45AM

When I need to add a thought or two to a message already sent I use the MailFollup plugin by Greg Welch. <code>http://www.cs.unc.edu/~welch/MailFollowup/</code> The term 'followup' clearly identifies such a message as an afterthought or added thought. Works well. Plays nice with Letterbox and MailTabs. (Caveat - I have no relationship with Greg Welch or the plugin beyond being a satisfied user.)

Edited on Jun 13, '11 04:28:35AM by rgray



[ Reply to This | # ]
Change Mail behavior when replying to a message in the Sent mailbox
Authored by: ccstone on Jun 15, '11 02:58:17AM
Others have covered the features of Mail (and plugins) that make this script's utility questionable, so I'll confine my comments to the Applescript code.

Original: set theMessages to the selected messages of the front message viewer

This line is very problematic, because it will not work if there is more than one message viewer open, and the front MV is not the first one opened.

This will fix that: set theMessages to the selected messages of some message viewer whose index is 1

Let us also please have at least basic error-checking:

try
  # Script Body
on error errMsg number errNum
  set sep to "=============================="
  set e to sep & return & "Error: " & errMsg & return & sep & return 
    & "Error Number: " & errNum & return & sep
  beep
  display dialog e
end try

Setting aside the merits of the script, let's rewrite it in more sturdy fashion just for the exercise:

tell application "Mail"
  try
    set quoteOriginalMessagePref to quote original message
    set selectedMsg to (get selected messages of some message viewer whose index is 1)'s 1st item
    if selectedMsg's mailbox's name = "Sent Messages" then
      tell selectedMsg
        set recipientList to {name, address} of its recipients
        set newOutgoingMessage to reply with opening window
      end tell
      delay 0.05 # This value might need adusting to allow the quoted material to show up.
      if quoteOriginalMessagePref = true then set quote original message to false
      tell newOutgoingMessage
        set address of to recipients to ""
        repeat with ndx from 1 to length of (item 1 of recipientList)
          make new recipient at end of to recipients with properties 
            {name:item ndx of item 1 of recipientList, address:item ndx of item 2 of recipientList}
        end repeat
      end tell
      if quoteOriginalMessagePref then set quote original message to true
    else
      error "Selected Messages Not in 'Sent Messages' Mailbox"
    end if
  on error errMsg number errNum
    try
      set quote original message to quoteOriginalMessagePref
    end try
    set sep to "=============================="
    set e to sep & return & "Error: " & errMsg & return & sep & return 
      & "Error Number: " & errNum & return & sep
    beep
    display dialog e
  end try
end tell

Kudos to the O.P. for figuring a way around Mail's evil multiple-quotation bug.

I prefer to run this sort of thing with FastScripts (a recent MacGem), because it handles app-specific keyboard shortcuts better than Mac OS X's service menu and has other useful features.

-ccs

Edited on Jun 15, '11 03:05:43AM by ccstone


[ Reply to This | # ]