Hello all,
I'm xposting to TBBeta and TBUDL because not everyone is on both lists.
Last Sunday, in TBUDL, George M. Menegakis expressed his wish for a
Scoring System for TB in his <mid:[EMAIL PROTECTED]>
and some others agreed it would be a nice feature to have in TB.
I thought such a system could somewhat easily be implemented with a few
filters taking advantage of the 'user parameters' in the Filter System.
I tried and it didn't work. As I later found out there was a problem
with the syntax for using parameters with the %Calc macro. Well, this
has been corrected in the latest Beta released today (v3.72.07) and my
'proof of concept' for a scoring system now works.
It's a simple example with two filter trees:
Score
Test for TEN
Test for TWENTY
See if Score >= 10
See if Score >= 20
Act on Score
Act on Score >= 10
Act on Score >= 20
What this simple 'proof of concept' does is to see if the words TEN or
TWENTY appear in the Subject of an incoming message and will add 10 to
Score if either one appears. So, a message with only one of the words
will get a score of 10 and if both appear the score will be 20.
What the action filters do is 'Flag' the message if the score is >= 10 and
'Mark as Parked and Read" if score >= 20. So, a message with only one of
the words will be Flagged and one with both words will be Flagged,
Parked and Read.
I make use of the %Calc and %UserParams macros. 'Calc' is well described
in TB's Help and what the 'UserParams' does is return the value of a
user parameter. Its syntax is: %UserParameter("ParameterName").
If you want to see more detail or even test this 'system', copy each of
the filter trees included below and paste them in your Incoming Filters.
$$$$ TB! Message Filter $$$$
beginFilter
UID: [CCD2333A.01C656A2.04C95E3E.567F533A]
Name: Score
Filter: {\0D\0A\20`21\0D\0A}
UserParam param Score value 0
IsContinue
IsActive
Ignore
endFilter
1
beginFilter
UID: [1FA98860.01C656A3.325F741C.3CA43891]
Name: Test\20for\20TEN
Filter: {\0D\0A\20`2`0`TEN\0D\0A}
UserParam param Score value %Calc\3D\27%UserParams(\22Score\22)+10\27
IsContinue
IsActive
Ignore
endFilter
1
beginFilter
UID: [C231F47E.01C656A7.0F159CB5.01E5A58B]
Name: Test\20for\20TWENTY
Filter: {\0D\0A\20`2`0`TWENTY\0D\0A}
UserParam param Score value %Calc\3D\27%UserParams(\22Score\22)+10\27
IsContinue
IsActive
Ignore
endFilter
1
beginFilter
UID: [5D3DC4E8.01C656A3.2CEC20D7.684C0437]
Name: See\20if\20Score\20>\3D10
Filter: {\0D\0A\20`21\0D\0A}
UserParam param 10orGreater value %Calc\3D\27%UserParams(\22Score\22)>\3D10\27
IsContinue
IsActive
Ignore
endFilter
1
beginFilter
UID: [FEBD8C00.01C656A7.7F386BBB.558B4CAE]
Name: See\20if\20Score\20>\3D\2020
Filter: {\0D\0A\20`21\0D\0A}
UserParam param 20orGreater value %Calc\3D\27%UserParams(\22Score\22)>\3D20\27
IsContinue
IsActive
Ignore
endFilter
$$$$ TB! Message Filter $$$$
beginFilter
UID: [858997C2.01C659BB.74520C5A.4ED129C6]
Name: Act\20on\20Score
Filter: {\0D\0A\20`27`10orGreater`0`1\0D\0A1`27`20orGreater`0`1\0D\0A}
IsContinue
IsActive
Ignore
endFilter
1
beginFilter
UID: [FCAA19F2.01C659B7.696B6C6D.4671D625]
Name: Act\20on\20Score\20>\3D\2010
Filter: {\0D\0A\20`27`10orGreater`0`1\0D\0A}
Flag
IsContinue
IsActive
Ignore
endFilter
1
beginFilter
UID: [578FC132.01C659B8.77D908C0.0DC8AFC5]
Name: Act\20on\20Score\20>\3D\2020
Filter: {\0D\0A\20`27`20orGreater`0`1\0D\0A}
MarkRead
Park
IsContinue
IsActive
Ignore
endFilter
*NOTE 1: If instead of comparing for >= you only needed to compare for
=, the 'See if Score' sub-filters would not be needed as you could
directly check the value of 'Score' in the conditions of the 'Act on
Score' sub-filters. They would not be needed either if in filter
conditions 'user parameters' could also be checked for 'greater than'
and 'less than' and not just for 'equal to' and 'not equal to'.
**NOTE 2: If instead of taking actions in filters you wanted to use Score
in Virtual Folders, you can make use of the 'Set Memo' action in filters
to pass the score and then check Memo in your VF.
REMEMBER: This will only work with v3.72.07 (and hopefully with newer
ones).
Enjoy! :)
--
Best regards,
Miguel A. Urech (El Escorial - Spain)
Using The Bat! v3.72.07 (Beta) on Windows XP 5.1 Service Pack 2
________________________________________________
Current version is 3.71.03 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html