View previous topic :: View next topic |
Author |
Message |
ASID Apprentice
Joined: 22 Mar 2006 Posts: 195
|
Posted: Wed Jul 19, 2006 8:27 am Post subject: TIP: Attach files to Thunderbird service menu |
|
|
Here is a small script that is able to attach more than one files on a new composed mail under thunderbird. This script is very simple so that people with no script knowledges could understand it. Some parts of the script comes from various sources.
First we create a file called attach_mail service in /usr/local/bin
You can of course name it anyway you want and place it wherever you want. Just make sure that you have permissions to run the script (we also make it executable).
Code: | #! /bin/bash
#
# Script created by ASID
# Attach files to thunderbird
temp=""
count=0
for i in $*
do
count=$(( $count + 1 ))
if [ $count -eq $# ]
then
temp=${temp}file://${i}
else
temp=${temp}file://${i},
fi
done
if thunderbird -remote "ping()" 2> /dev/null ;
then
thunderbird -remote "xfeDoCommand(composeMessage,attachment='$temp')"
else
thunderbird --compose "attachment='$temp'"
fi
|
The next step is to create the service menu. Name the following file AttachToThunderbirdMail.desktop or WhateverYouWant.desktop and place it in your ~/.kde/share/apps/konqueror/servicemenus/ directory. If the servicemenus directory does't exist, you can create it without fear.
Code: | [Desktop Entry]
Encoding=UTF-8
ServiceTypes=all/all
Actions=attachToEmail
[Desktop Action attachToEmail]
Name=Attach to Mail
Icon=attach
Exec=/usr/local/bin/attach_mail_service %F |
If you placed the 1st script in another directory, you must make the change also in the Exec command of the second file. Now, by changing the Name you change the text displayed under the Actions menu, when you right click on files.
Finally you can customise it on your local language by adding Name[it]= if you are Italian, Name[el]= if you are Greek,etc, and writing the text you want to be displayed on you native language.
Hope you enjoy |
|
Back to top |
|
|
KaZeR Apprentice
Joined: 04 Feb 2004 Posts: 291 Location: Au fond, à droite.
|
|
Back to top |
|
|
ASID Apprentice
Joined: 22 Mar 2006 Posts: 195
|
Posted: Fri Jul 21, 2006 1:57 pm Post subject: |
|
|
Thanks!
Hmmmmm, how?! |
|
Back to top |
|
|
KaZeR Apprentice
Joined: 04 Feb 2004 Posts: 291 Location: Au fond, à droite.
|
Posted: Fri Jul 21, 2006 2:13 pm Post subject: |
|
|
First, you'll need to create an account on the wiki. This became necessary because of spammers, flooders and other bitches.
Then i suggest you read http://gentoo-wiki.com/Help:Editing
Using a wiki is really easy, and fast.
Quick howto :
Once logged, you'll get an 'edit this page' button on every page you'll read.
You'll also get an 'edit' button right after each chaptermarks, making it easier for you to choose where to put your tip.
Your tip can go in the Mozilla subchapter, so click on the Edit right after Mozilla.
You'll see how other links are made. You can base you own on these examples.
You'll need to create an new page (which is done simply by linking to an empty page, e.g. [Tip : Multifile mail with thunderbird]
The [ and ] denotate an url. If the text between the [ ] (brackets, right?) is a string, the it's parsed as a page title.
So create the link to your new page, and save the changes.
Now your link will appear RED meaning that the page does not exists. Just click the link, you'll be sent directly to the page edit choice. Then write up your page, and save, done!
If you need help, post back (maybe in another topic, since the subject is sliding here) and I can help you formatting this page if you wish (this is the main goal of a wiki : multi editor content).
Wikis are really usefull IMO, don't forget to check out wikipedia.org!
Good luck!
_________________ Foo. |
|
Back to top |
|
|
ASID Apprentice
Joined: 22 Mar 2006 Posts: 195
|
Posted: Mon Jul 24, 2006 8:55 am Post subject: |
|
|
Done!
KaZeR, thanks for the help! Please, have a look at it http://gentoo-wiki.com/Index:TIP and tell me if you like the formating. Of course, any suggestions are always more than welcome... |
|
Back to top |
|
|
KaZeR Apprentice
Joined: 04 Feb 2004 Posts: 291 Location: Au fond, à droite.
|
Posted: Mon Jul 24, 2006 9:50 am Post subject: |
|
|
Clear, precise... Nice!
Wiki is a great tool, isn't it? Share your knowledge now! _________________ Foo. |
|
Back to top |
|
|
mlebek Tux's lil' helper
Joined: 07 Mar 2004 Posts: 125
|
Posted: Sun Sep 22, 2013 9:47 pm Post subject: |
|
|
the script works fine except for files with blanks in filename.
It seems that blanks are removed by the script?
Can somebody help to fix that? |
|
Back to top |
|
|
ASID Apprentice
Joined: 22 Mar 2006 Posts: 195
|
Posted: Mon Sep 23, 2013 9:17 am Post subject: |
|
|
Seven years later and someone is still using my script?!
I think there is an easier way to achieve this.
Remove attach_mail script. You don't need it.
Then replace the line Code: | Exec=/usr/local/bin/attach_mail_service %F | in the AttachToThunderbirdMail.desktop file with the following:
Code: | Exec=/usr/bin/thunderbird-bin -compose "attachment='file://`echo %F | sed 's/\\ \\//,file:\\/\\/\\//g'`'" |
Of course make sure that you use the correct path to your thunderbird bin file.
Should do the trick |
|
Back to top |
|
|
mlebek Tux's lil' helper
Joined: 07 Mar 2004 Posts: 125
|
Posted: Mon Sep 23, 2013 10:19 am Post subject: |
|
|
ASID wrote: | Seven years later and someone is still using my script?!
|
your script will ever be my number one!! our staff members used it a thausand times!
ok, your new code works perfectly!
thank you very much! |
|
Back to top |
|
|
|