MozillaZine

how to copy sender's name and address to clipboard

User Help for Mozilla Thunderbird
Leopoldus
 
Posts: 353
Joined: April 8th, 2008, 4:29 am

Post Posted October 9th, 2008, 10:54 am

In TB 2.0.16 with installed add-on Mnenhy I can not copy the whole line of data from the field FROM to clipboard. Shortcut Ctr+C does not work at all, instead one can previously select text in a header's field and then use "copy selection" command from context menu.
But it is not possible to select any text in the field FROM.
Well, there is a command "Copy Email Address" in the context menu for FROM field, but I need to copy the both address and the sender's name.
As I need this feature many times per hour, this is a real problem for me. Could somebody offer any workaround? May be some key via KeyConfig?

Thanks in advance!

DanRaisch
Moderator

User avatar
 
Posts: 119215
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post Posted October 9th, 2008, 10:57 am

You could use Ctrl+U and copy the From: entry from the message source screen.

Leopoldus
 
Posts: 353
Joined: April 8th, 2008, 4:29 am

Post Posted October 9th, 2008, 11:34 am

You could use Ctrl+U and copy the From: entry from the message source screen.

Thanks, but is takes huge time to find the proper line in the source code window. I've tried it in practice and can confirm, that re-entering the whole line manually takes almost the same time :(

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted October 10th, 2008, 11:38 am

Leopoldus wrote:May be some key via KeyConfig?
Add a new key with
Code: Select all
var hdr = messenger.msgHdrFromURI(GetSelectedMessages()[0]);
Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.
getService(Components.interfaces.nsIClipboardHelper).copyString(hdr.author); 

cyberpitboss

User avatar
 
Posts: 8
Joined: May 2nd, 2006, 10:49 am

Post Posted October 10th, 2008, 12:26 pm

The easiest way that I have found to do what you want is to use choose "compose mail to" from the context menu and then from the new message window you can quickly copy the whole thing. It only takes a second or two extra but it works very well.

Leopoldus
 
Posts: 353
Joined: April 8th, 2008, 4:29 am

Post Posted October 10th, 2008, 1:36 pm

dorando wrote:
Leopoldus wrote:May be some key via KeyConfig?
Add a new key with
Code: Select all
var hdr = messenger.msgHdrFromURI(GetSelectedMessages()[0]);
Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.
getService(Components.interfaces.nsIClipboardHelper).copyString(hdr.author);  


Thank you, it works!
However there is one issue here too: this key copies the sender's name source code, not how it is displayed in the message window. That means, if a sender's name includes some non-English encoding characters (as German umlaut letters Ä, Ü etc.), say Heinrich Böll, the source code for the sender's Heinrich Böll is copied as =?ISO-8859-1?Q?Heinrich_B=F6ll?= <Heinrich.boll@hot.de> or if in the message uses Unicode the name will be copied even as Heinrich =?UTF-8?B?QsO2bGwgLSBVVEYtOA==?= <Heinrich.boll@hot.de>.

It would be fine to get some way to copy the sender's name to clipboard just in the form as it is shown in the field "FROM" in a message window and preview pane.

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted October 12th, 2008, 9:03 am

Try
Code: Select all
var fullAddress = document.getElementById("expandedfromBox").mAddresses[0].fullAddress;
Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.
getService(Components.interfaces.nsIClipboardHelper).copyString(fullAddress); 

Leopoldus
 
Posts: 353
Joined: April 8th, 2008, 4:29 am

Post Posted October 12th, 2008, 9:22 am

dorando wrote:Try
Code: Select all
var fullAddress = document.getElementById("expandedfromBox").mAddresses[0].fullAddress;
Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.
getService(Components.interfaces.nsIClipboardHelper).copyString(fullAddress); 


Seems it does not work at all (does not copy anything) :(
Does it work at your machine?

klades
 
Posts: 855
Joined: May 3rd, 2004, 1:20 pm

Post Posted October 12th, 2008, 9:33 am

dorando wrote:
Leopoldus wrote:May be some key via KeyConfig?
Add a new key with
Code: Select all
var hdr messenger.msgHdrFromURI(GetSelectedMessages()[0]);
Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.
getService(Components.interfaces.nsIClipboardHelper).copyString(hdr.author);  


Use hdr.mime2DecodedAuthor instead hdr.author

Leopoldus
 
Posts: 353
Joined: April 8th, 2008, 4:29 am

Post Posted October 12th, 2008, 10:04 am

klades wrote:Use hdr.mime2DecodedAuthor instead hdr.author

This really works! Now I have and can use the both options as I needed. Thank you!

Leopoldus
 
Posts: 353
Joined: April 8th, 2008, 4:29 am

Post Posted April 2nd, 2009, 1:28 am

To continue the same subject, what should one to write in the code for KeyConfig key in order to copy the addressee and his/her address? I guess that the difference is in the line copyString(hdr.author);, but what is the correct name of the string for addressee?
Thanks!

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted April 5th, 2009, 10:30 am

Try
Code: Select all
hdr.mime2DecodedRecipients

LIMPET235
Moderator

User avatar
 
Posts: 38157
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Post Posted January 2nd, 2018, 12:58 am

Rakka7,
I split your post off to here...
> viewtopic.php?f=39&t=3037008
as this old thread needs it's rest.

Locking.
Ancient Amateur Astronomer
Win-7-HP/Intel® DualCore-2.0GHz/500G HDD/4 Gig Ram/550Watt PSU/350WattUPS/Firefox-20.0-57.0/T-bird-2.0.0.24/SnagIt-v10.0.1/MWP-7.11.0.
RadioYachting. (Always choose the "Custom" Install.)

Return to Thunderbird Support


Who is online

Users browsing this forum: Bing [Bot], wsmwk and 9 guests