It's exciting to see someone trying to use the javascript search term, as this is a new feature.
The issue with your js is not obvious to me, but let me give you some pointers on how to debug this, and other issues.
I debug javascript with lots of prints. There are two easy ways to do this. First, this statement:
Cu.reportError('some text');
will put a line of text on the Error Console, which you can view from the Tools menu. Second, this statement:
dump('some text\n');
will put a line of text on the DOS console. But to see the DOS console, you will need to start thunderbird with the -console option.
Then, some cautions. The 'keywords' string is a list of space-separated tag keys. For tag numbers greater than 5, the key is the same as the original name that you gave the tag (not sure of capitalization though) and it does not change if you rename the tag. But for tags 1 – 5, for legacy reasons the tag keys are "$label1" – "$label5". That means that your keywords will contain "1" if it is assigned the first tag, which defaults to "Important". (Another issue with "keywords" is that it may contain deleted tag keys, and under some circumstances IMAP flags like "Junk" and "NonJunk" get added.) So normal practice in production code would be to cleanup these issues, and there are various examples I could point you to to do this. It takes about 10 lines of js. But if this is just for private use, you could work around this fairly simply. For example, make sure that your new tags are number 6 or greater, and give them slightly more complex names, like '1Day" and '2Days' that would avoid collision with '$label1' in the regex search.
Recent Comments