Author Topic: Thunderbird Service Menu [solved]  (Read 883 times)

Offline bebolinux

  • New Friend
  • *
  • Posts: 9
Thunderbird Service Menu [solved]
« on: January 30, 2010, 03:22:20 PM »
This service menu will allow you to right click on one or more files and attach it to a new E-mail with Thunderbird.

Whit Dolphin open as root the phat /usr/share/kde4/services/ServiceMenus (right-click)
Create a empty txt file into path "/usr/share/kde4/services/ServiceMenus"  and rename it as "mail_as_thunderbird_attachment.desktop".
Copy and paste this into file

[Desktop Entry]
Actions=attachToEmail
Encoding=UTF-8
ServiceTypes=KonqPopupMenu/Plugin,all/allfiles
ExcludeServiceTypes=application/x-iso,kdedevice/*,inode/directory
Type=Service

[Desktop Action attachToEmail]
Name=Attach to Thunderbird Mail
Name[fr]=Envoyer avec Thunderbird Mail
Name[it]=Allega a Thunderbird Mail
Icon=mail-send
Exec=thunderbird -compose attachment="%F"


Now you can  with right click on one file and chose Attach to Thunderbird Mail

bye

Offline holljac

  • Jr. Member
  • **
  • Posts: 24
Re: Thunderbird Service Menu [solved]
« Reply #1 on: February 06, 2010, 10:28:10 PM »
I've been trying to solve this one myself. I have managed to get the following to work to attach multiple files. I ended up making some small changes to one from kde-apps.org. Place a shell script called attach_mail_service, make sure it's executable, in your home directory bin ie: ~/bin. The contents are as follows:

Code: [Select]
#! /bin/bash
#
# Script created by ASID
# Attach files to thunderbird

temp=""
#temp2=""
#subject="mailing files: "
count=0
for i in $*
do
count=$(( $count + 1 ))
if [ $count -eq $# ]
then
temp=${temp}file://${i}
#temp2=${temp2}file://${i}
else
temp=${temp}file://${i},
#temp2=${temp2}file://${i},
fi
done

#subject=${subject}${temp2}
if mozilla-thunderbird -remote "ping()" 2> /dev/null ;
then
mozilla-thunderbird -remote "xfeDoCommand(composeMessage,attachment='$temp')"
#,subject='$subject')"
else
mozilla-thunderbird --compose "attachment='$temp'"
fi



Now place a file named AttachToThunderbirdMail.desktop in your ~/.kde4/share/kde4/services/servicemenus directory. The contents are as follows:

Code: [Select]
[Desktop Entry]
Encoding=UTF-8
ServiceTypes=all/allfiles,KonqPopupMenu/Plugin
Actions=attachToEmail
Type=Service

[Desktop Action attachToEmail]
Name=Attach to Email
Icon=/usr/share/pixmaps/mozilla-thunderbird.png
Exec=~/bin/attach_mail_service %F


You should be able to right click on a file or multiple files and have a context menus of Action | Attach To Email. It works for me. YMMV.