#!/bin/bash #Author: Copyright Jelle de Jong #Note: Please send me an email if you enhanced this script #Version: 0.0.4 #Date: 04-12-2006 / 28-04-07 / 22-10-07 / 2009-07-06 #System: Ubuntu/Debian GNU/Linux #Information: http://www.mozilla.org/docs/command-line-args.html#Syntax_Rules #Category Thunar scripts #Name: Create Email #Description: Create email with selected files as attachments in thunderbird #Command: xfce4-terminal --disable-server --hide-toolbars --execute /usr/share/pct-thunar-scripts/scripts/send-mail %F #Patterns: * #Directories: True #Audio Files: True #Image Files: True #Text Files: True #Video Files: True #Other Files: True # Did the script work for you? # Yes # Yes, but with some errors # Yes, but I had to change some things # Not at all # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. TEXTDOMAINDIR=/usr/share/locale TEXTDOMAIN=${0##*/} NAME=$"Create Email" DESCRIPTION=$"Create email with selected files as attachments in thunderbird" cecho() { case "$1" in "black") echo -ne "\E[30m" ;; "red") echo -ne "\E[31m" ;; "green") echo -ne "\E[32m" ;; "yellow") echo -ne "\E[33m" ;; "blue") echo -ne "\E[34m" ;; "magenta") echo -ne "\E[35m" ;; "cyan") echo -ne "\E[36m" ;; *) echo -ne "\E[30m" exit ;; esac echo "$2" "$3" tput sgr0 } cecho "green" $"program:" echo "$0" cecho "green" $"description:" echo "$DESCRIPTION" cecho "green" $"process these file(s):" for I in "$@" do file=${I##*/} cecho "cyan" "$file" done for I in "$@" do dirname=${I%/*} file=${I##*/} filename=${I##*/}; filename=${filename%.*} extension=${I##*.} cecho "green" $"starting with:" cecho "cyan" "$file" body_query+="$file"$'\n' subject_query="$filename" if [ -f "$I" ] then echo $"Add regular file to attachment query" if [ "$attachment_query" != "" ] then attachment_query+="," fi attachment_query+="file://$I" else echo $"Selection is not a regular file" fi cecho "green" $"completed" cecho "cyan" "---------------" done if [ "$attachment_query" != "" ] then attachment="'$attachment_query'" subject="'$subject_query'" body=$'This message contains the following attachment(s):\n'"${body_query}" [ -e /usr/bin/icedove ] && application="icedove" [ -e /usr/bin/thunderbird ] && application="thunderbird" cecho "green" $"starting application:" echo "$application --compose \"subject=$subject,attachment=$attachment,body=$body\"" $application --compose "subject=$subject,attachment=$attachment,body=$body" fi cecho "green" $"done, closing after 3 seconds" sleep 3 exit 0