Topic RSS
Hello,
There are some messages that I'd like to be able to give extra special attention to, like faxes I might receive as an email attachment. I'd like to be able to add a filter action to show me a window that says something like, "Filter name 'Fax Detection' has just processed a message with the subject 'Fax received from (555) 555-1212' and an email date of 11/13/2010 from email address faxserver@work.com" Then, it should have an OK button to force me to see it and acknowledge it.
What you want to do is pretty easy with a javascript custom filter. As an example, the following javascript custom action will output an alert with the message subject:
for (let index = 0; index < msgHdrs.length; index++)
{
let hdr = msgHdrs.queryElementAt(index, Ci.nsIMsgDBHdr);
alert('subject is ' + hdr.subject);
}
(Based on the sample at http://mesquilla.com/extension……taquilla/)
Thanks for this! I don't know javascript so I wouldn't have known where to start. I've added it.
I didn't have "Javascript Action" checked in the FiltaQuilla preferences. Once I checked it, I had to restart Thunderbird before it would appear as an option under "Perform these actions." Is this working correctly — that I just need to remember to restart TB if I make a change to the FiltaQuilla preferences? (Which I can do — just wanted to mention it in case this wasn't by design.)
rkent said:
The window where you modify available preferences alread says "restart after changes" at the top.
Doh! Doh! Of course it does! Sheesh, I've got to stop mixing cola brands when I'm trying out new TB extensions. :D
I've been putting the javascript to good use, and although it does exactly what I asked for, I've discovered that when the alert window pops up, all rule processing stops until I click on OK. I have TB running all the time applying different filters, so when I'm away at work and one of the alerts pops up, I'm not there to click on OK. I still =need= it to stop and wait for me to acknowledge the alert, though.
Is it possible to:
1) Have javascript spawn a new process/task/something, that would handoff the alert job to it, and the rule processing would be able to continue along.
or
2) Have javascript do something like the infamous netcat tool that allows simple communication to a listening server and port. This would sort of allow what #1 above suggests, as netcat can be told to send out a text message and not wait for a reply. I already have a Mac set up to listen to such messages (it's called ncid, http://ncid.sourceforge.net/).
Yes, you could call the alert from a setTimeout, which would then allow processing to continue. So whatever you are calling (which I will say is "alert('The Message');" then you would wrap it like this:
setTimeout ("alert('The Message')", 0);
If the value of The Message changes, then you will need to contruct the text for the message as a string.
Most Users Ever Online: 18
Currently Online:
11 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Member Stats:
Guest Posters: 130
Members: 565
Moderators: 1
Admins: 1
Forum Stats:
Groups: 1
Forums: 7
Topics: 231
Posts: 802
Newest Members: Matteo, p.dobrogost, gaute, Mythobeast, terry, Livraria Notre Dame
Moderators: rkent (323)
Administrators: rkent (323)
Log In
Register
Members
Home
Add Reply
Add Topic
Offline
Quote

Recent Comments