17

I need to process a number of messages in my Thunderbird.app (Mac OS X Snow Leopard, Intel Core 2 Duo), delete a few based on some criteria, export some others, move a small part of them to a special folder and create a filing hierarchy to go with it all - programmatically.

With Outlook I used to enjoy VBScript + the COM object model: it would do all of the above simply and intuitively.

What can I use to achieve the same with Thunderbird?

If multiple options are available, here are my current preferences in terms of languages (although I can adapt to most things): Python, C++, AppleScript, PHP, Perl, Bash, ...

If I need to move to a Windows box to use .NET and the like, I can (yet I'd imaging the most popular bindings come from the open-source world?!) If there was a command-line tool that did what I need, I'd use that! (thunderbird.sh show messages; thunderbird.sh create folder X as child of folder Y;)

pkamb
  • 33,281
  • 23
  • 160
  • 191
Maroloccio
  • 1,143
  • 2
  • 12
  • 22

4 Answers4

10

You can develop Thunderbird extensions in a similar way to Firefox extensions in XUL and Javascript.

Try this tutorial.

This tutorial will introduce you to the components of a Thunderbird extension and will show you how to build your own.

Gelatin
  • 2,393
  • 1
  • 24
  • 29
  • 2
    The one problem with this is that XUL/JS extensions are scripting entirely inside TB and with it's UI. I suspect the original poster meant being able to script it from the outside - so other apps on his apple desktop can perform TB actions - like prep a mail based on a PDF from a print workflow. – Danny Staple Oct 08 '12 at 22:10
  • Or maybe not - I knew what I was looking for - but I needed to rtfq, the OP means automation purely inside TB - in which case this is the correct answer. – Danny Staple Oct 08 '12 at 22:12
  • 1
    The link in this answer is outdated; see my answer below for the current way to go, or go directly to https://developer.thunderbird.net/add-ons/about-add-ons – Oliphaunt Jan 10 '20 at 09:57
4

You could also look at the tbscript plugin, although it does have external dependencies - it uses Python.

Darael
  • 331
  • 1
  • 6
3

The tutorial linked to in the most popular answer as of today still works, but is outdated.

For current versions of Thunderbird, documentation is at https://developer.thunderbird.net. This has an add-on page that comes with a tutorial for developing a "Hello World" MailExtension.

The MailExtension API is new for Thunderbird 68 (although some parts were published for earlier versions) and allows one to write JavaScript to e.g. handle messages.

Oliphaunt
  • 200
  • 9
-2

If you need a general purpose GUI scripting solution, try Autohotkey, it's very calable.

Zsolt Botykai
  • 50,406
  • 14
  • 85
  • 110