18

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;)

4 Answers 4

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.

3
  • 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. Oct 8, 2012 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. Oct 8, 2012 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 developer.thunderbird.net/add-ons/about-add-ons
    – Oliphaunt
    Jan 10, 2020 at 9:57
4

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

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.

-3

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.