1

It is not always convenient to have every individual you deal with in your contact list.

In these occasions I use /+smith, to find previous interactions with Mr/s Smith and when I get to the message I:

a) click "Show details",
b) mouse-select the from field (or to or cc),
c) Ctrl+C.

Eventually I start composing a new message with C, Ctrl+V and edit the previous copied address from rubbish symbols like <, >.

Very very long and boring (particularly when you have to select names from long cc-lists). There should be an easier way. In particular a shortcut to select/copy the addresses from the message contact fields without manual mouse selection.

What do you suggest to do?

1

My bookmarklets

Below you find a link to two bookmarklets I posted on jsfiddle. If you drag them on your browser toolbar, when you open a Gmail message, clicking a bookmarklet pops up a window with sender and recipients addresses (including CC's). Since it is a popup window, in Windows, just hit Ctrl-A, Ctrl-C and you get them selected and copied in your clipboard. Eventually Ctrl-W (or Alt-F4) will close the popup window (for a non-Windows OS you should use the equivalent keys).

jsfiddle bookmarklets + code

jsfiddle bookmarklets only

The one bookmarklet named contLong will show, when available in the message, the long format "John Smith <johnsmith@example.com>"; instead contShort will only show the Gmail internally stored email addresses.

The bookmarklets were tested with Firefox and Chrome for Windows. No need to mention that to view the output window you might need to:
allow popups from https://mail.google.com domain.

The javascript code

Here is the bookmarklets' code. Do customise the first three code lines:
internals=true enables the short format based on the internal addresses;
width and height refer to the pixel size of the popup.

tutsplus.com gives some background info on bookmarklets, in case you need it.

Comments on both javascritpt code and functionality are greatly appreciated.

javascript:(function(){
/* Get from, to, cc fields from Gmail */

/* --- Customise these vars ---
 * Use only internally stored address? 
 * Set size of output window.         */
var internals=true, 
    width=400,
    height=400;

/* Glocal objects */
var  txt='', contPad,    
     getContacts=function(spanPos){
      var c=contPad[spanPos].firstChild.querySelectorAll('span.gI > span');
       if(spanPos==0){
        if(internals) txt+= c[0].getAttribute('email') + '<br>'; else
          txt+= c[0].innerHTML + ' '+ c[1].innerHTML + '<br>';
       } else
         for (var i = 0; i < c.length; i++)
           if(internals) txt+= c[i].getAttribute('email') + '<br>';
           else txt+= c[i].innerHTML + '<br>';
       return txt; 
     };


/* Check page */
var loc=window.location;
if(loc.origin != 'https://mail.google.com'){
  alert('You are not on a Gmail page.');
  return;
}
if(!/inbox\/[^/]+$/.test(loc)){
  alert('Run the bookmarklet on an open message');
  return;
}

/* Prepare output window */
var wconf= 'width=' + width + ',height=' + height +
                ',scrollbars=yes,status=no,titlebar=no,toolbar=no',
     contacts=window.open('','Gmail_Message_Contacts', wconf);  

/* Simulate click on 'to' triangle drop down to show contatcs */
var triangle=document.querySelector( 'div.ajy' ).firstChild ;
triangle=triangle.getAttribute('id');
triangle = document.getElementById(triangle);
var event = document.createEvent('MouseEvents');
event.initEvent('click', true, true);
triangle.dispatchEvent(event);
contPad = document.querySelectorAll('td.gL');

/*from:  span pos 0 */
txt+='<b>From:</b><br>';
txt=getContacts(0);

/*to:  span pos 1 */
txt+='<br><b>To:</b><br>';
txt=getContacts(1);

/*cc*:  span pos 2 */
txt+='<br><b>CC:</b><br>';
txt=getContacts(2);

/* Close Gmail  `to'  drop down*/
triangle.dispatchEvent(event);

/*Write results in  popup */
contacts.document.body.innerHTML=txt ;
contacts.focus();

}())
0

I use Outlook 2013 mostly and this problem doesn't exist there. Hover the cursor over a From address and a floating dialog presents you with a "new email" button. If you can use Outlook, set gmail up as IMAP. That would be my first choice. Other local mail clients may have similar features built into their GUI and can also be configured to use gmail with IMAP.

Sometimes when I am using a webmail account such as gmail, when I find the previous email, I hit the reply button. Then click in the body and type ctrl-A (select all) and hit the delete or backspace button, then clear out the subject and fill in the new, and type my email.

This process is better to me than the copy and paste the email address method that you use for two reasons: 1) it avoids the tedious editing that is exactly as you describe. 2) this email still carries valid "reply" headers as part of the full headers, as such, it's highly unlikely my email will end up in the receivers spam folder.

  • You might want to try the bookmarklets in my answer – antonio Jan 2 '15 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.