attachments name

Discussion of general topics about Mozilla Thunderbird
Post Reply
Urraco
Posts: 12
Joined: October 12th, 2021, 5:34 am

attachments name

Post by Urraco »

Hi,
Is there any way so i can I attach the name of the all attachments in the body email?
Thank you.

e.g

1. Attachments 1.jpeg
2. Attachments 2.txt
3....
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: attachments name

Post by tanstaafl »

I'm not aware of a way or setting to automate copying the name of any attachments into the message body. Most attachment add-ons seem to be for extracting or viewing attachments, or adding more information in the folder listing.

Thunderbird supports using a filelink service (instead of attaching a large attachment) but it requires you to attempt to attach a file (and respond to the offer to use a filelink service instead) so that doesn't help.
DN123ABC
Posts: 695
Joined: January 9th, 2017, 10:10 am

Re: attachments name

Post by DN123ABC »

This sounds like a useful function. It would be nice to see this available at some time. Maybe an addon and then eventually in the program. Much better than a lot of the stuff we've seen.
User avatar
WaltS48
Posts: 5141
Joined: May 7th, 2010, 9:38 am
Location: Pennsylvania, USA

Re: attachments name

Post by WaltS48 »

DN123ABC wrote:This sounds like a useful function. It would be nice to see this available at some time. Maybe an addon and then eventually in the program. Much better than a lot of the stuff we've seen.
I would be able to disable it. Right? [-o<
Linux Desktop - AMD Athlon(tm) II X3 455 3.3GHz | 8.0GB RAM | GeForce GT 630
Windows Notebook - AMD A8 7410 2.2GHz | 6.0GB RAM | AMD Radeon R5
User avatar
BruceAWittmeier
Posts: 3076
Joined: June 9th, 2008, 10:53 am
Location: Near 37.501685 -80.147967

Re: attachments name

Post by BruceAWittmeier »

Urraco wrote:Hi,
Is there any way so i can I attach the name of the all attachments in the body email?
Thank you.

e.g

1. Attachments 1.jpeg
2. Attachments 2.txt
3....
I read into your question a bit differently. Is your question "is there a way to list attached files (basically full path even on your PC) and have the message text provide the attaching and send the files without a separate attachment process?
I often take a long windy road to my destination. Upon arrival, I wonder how I missed the shortcut.
Urraco
Posts: 12
Joined: October 12th, 2021, 5:34 am

Re: attachments name

Post by Urraco »

Soory for my blurry question...
Sometimes, when the body email has a lot of text ,the recipient may not notice the attachment, so I would like to add the file name of the attachment into the body mail too, if attachment exist...
Can this be done?
Thank you

something like this:


Image

https://ibb.co/B6tdbbb



BruceAWittmeier wrote:
Urraco wrote: I read into your question a bit differently. Is your question "is there a way to list attached files (basically full path even on your PC) and have the message text provide the attaching and send the files without a separate attachment process?
User avatar
BruceAWittmeier
Posts: 3076
Joined: June 9th, 2008, 10:53 am
Location: Near 37.501685 -80.147967

Re: attachments name

Post by BruceAWittmeier »

Not any way that I am aware of.

In the "Compose" mode of writing an email you can "Insert" an image directly into the email rather than sending as an attachment. I don't believe there is any gain/loss by either technique.
I often take a long windy road to my destination. Upon arrival, I wonder how I missed the shortcut.
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: attachments name

Post by morat »

You can create keyboard shortcuts that execute custom commands with the tbkeys addon.

tbkeys
http://github.com/wshanks/tbkeys#tbkeys

Here is a custom command to insert a list of attachment names into the editor.

Code: Select all

(function () {
  var bucket = window.document.getElementById('attachmentBucket');
  var names = [];
  for (var i = 0; i < bucket.getRowCount(); i++)
    names.push(bucket.getItemAtIndex(i).getAttribute('name'));
  window.goDoCommandParams('cmd_smiley', names.join('<br>'));
})();
More info: http://forums.mozillazine.org/viewtopic ... #p14872763
Urraco
Posts: 12
Joined: October 12th, 2021, 5:34 am

Re: attachments name

Post by Urraco »

I tried but it seems something is wrong
I use Mozilla Thunderbird 91.7.0 (64-bit)
I inserted the function in the addon but it is not saved..
thanks

Code: Select all

{
 "z": "(function () {
  var bucket = window.document.getElementById('attachmentBucket');
  var names = [];
  for (var i = 0; i < bucket.getRowCount(); i++)
    names.push(bucket.getItemAtIndex(i).getAttribute('name'));
  window.goDoCommandParams('cmd_smiley', names.join('<br>'));
})();"
}
morat wrote:You can create keyboard shortcuts that execute custom commands with the tbkeys addon.

tbkeys
http://github.com/wshanks/tbkeys#tbkeys

Here is a custom command to insert a list of attachment names into the editor.

Code: Select all

(function () {
  var bucket = window.document.getElementById('attachmentBucket');
  var names = [];
  for (var i = 0; i < bucket.getRowCount(); i++)
    names.push(bucket.getItemAtIndex(i).getAttribute('name'));
  window.goDoCommandParams('cmd_smiley', names.join('<br>'));
})();
More info: http://forums.mozillazine.org/viewtopic ... #p14872763
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: attachments name

Post by morat »

Here is a compose key bindings example for the tbkeys addon.

Code: Select all

{
  "ctrl+1": "window.alert('alpha');",
  "ctrl+2": "window.alert('beta');",
  "ctrl+3": "(function () { var text = 'gamma'; window.alert(text); })();"
}
Press Ctrl+1 to alert alpha.
Press Ctrl+2 to alert beta.
Press Ctrl+3 to alert gamma.

The settings page will not allow invalid JSON to be submitted.

Remember to remove the newline characters in custom commands so the input is a valid JSON string.

Remember to remove the trailing comma after the last key so the input is a valid JSON string.

JSON Validator
http://jsonlint.com/

Can you get the example working?

The example won't work with the tbkeys-lite addon since the tbkeys-lite addon can't run arbitrary javascript.
Last edited by morat on March 18th, 2022, 5:56 am, edited 2 times in total.
Urraco
Posts: 12
Joined: October 12th, 2021, 5:34 am

Re: attachments name

Post by Urraco »

still not working..

https://ibb.co/MMvbjNW
Image

not even this code not working

Code: Select all

{
  "ctrl+1": "window.alert('alpha');",
  "ctrl+2": "window.alert('beta');",
  "ctrl+3": "(function () { var text = 'gamma'; window.alert(text); })();"
}
morat wrote:Here is a compose key bindings example for the tbkeys addon.

Can you get the example working?

The example won't work with the tbkeys-lite addon since the tbkeys-lite addon can't run arbitrary javascript.
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: attachments name

Post by morat »

The following compose key binding works here.

Code: Select all

{
  "ctrl+3": "(function () { var bucket = window.document.getElementById('attachmentBucket'); var names = []; for (var i = 0; i < bucket.getRowCount(); i++) names.push(bucket.getItemAtIndex(i).getAttribute('name')); window.goDoCommandParams('cmd_smiley', names.join('<br>')); })();"
}
The command does nothing if there are no attachments.
The command does nothing if the editor is not selected.

Thunderbird 91.5.1
Windows 10 Pro 20H2 32-bit

Did you remember to click the save settings button? Try reopening the compose window. Try restarting the app.

BTW,

I doubt a "z" shortcut will work well in the compose window. How are you going to type zebra when the editor is selected?
Urraco
Posts: 12
Joined: October 12th, 2021, 5:34 am

Re: attachments name

Post by Urraco »

now it works...
thank you very much

morat wrote:The following compose key binding works here.

Code: Select all

{
  "ctrl+3": "(function () { var bucket = window.document.getElementById('attachmentBucket'); var names = []; for (var i = 0; i < bucket.getRowCount(); i++) names.push(bucket.getItemAtIndex(i).getAttribute('name')); window.goDoCommandParams('cmd_smiley', names.join('<br>')); })();"
}
Post Reply