Saturday, October 3, 2009

Thunderbird launch wrapper

This is a little wrapper script to launch Thunderbird mail composer, against for Mail.app compose script.
#!/bin/sh

for target in ${@+"$@"}
do
    case "${target}" in
    to=*)
      to="${target#*=}"
      ;;
    cc=*)
      cc="${target#*=}"
      ;;
    sender=*)
      sender="${target#*=}"
      ;;
    subject=*)
      subject="${target#*=}"
      ;;
    attach=*)
      attach="file://${target#*=}"
      ;;
    body=*)
      body="${target#*=}"
      ;;
    esac
done

exec thunderbird -compose "to=${to},cc=${cc},sender=${sender},subject=${subject},attachment=${attach},body=${body}"

No comments: