Listmembers:
Based on the recursive templates created by Januk, I created a couple
of templates that are supposed to create the salutation of a new
message. The desired effect is that even if I use 'bmarks, mgerritsen'
to address the message, where bmarks is Bill Marks and mgerritsen is
Marc Gerritsen, the salutation should be "Bill, Marc,"
Currently, this is working but for one small issue that I can't seem
to figure out: The names get placed on separate lines, instead of on
just one line. Can someone have a look at this and tell me what I'm
too confused about to see?
Here are the macro's concerned:
----- [ SALUTATIONLIST ]
%_SL_Num_Space(1)%-
%-
%_SL_OrgTo("%TOLIST")%-
%_SL_Text("%TOLIST; ")%-
%IF:"%_Debug"="1":"_SL_Text: %_SL_Text
%QINCLUDE(SALUTATIONLIST2)
"%-
%SETPATTREGEXP("^(?s)\s{%_SL_Num_Space}(.*?)[;,]\s*\Z")%-
%REGEXPMATCH('%QINCLUDE("SALUTATIONLIST2")')%-
%SETPATTREGEXP("^,\s(.*)\Z")%-
%TO=""%TO="%_SL_OrgTo"%-
----- [ SALUTATIONLIST2 ]
%REM='
Salutation List formatting routine using features from TB
1.63b11 and above
Copyright (C) 2004, Maurice Snellen
Based on the "Recipient List" reformatting routine by Januk
Aggarwasl written July 2003.
Notes:
1. This template can be used alone to reformat clipboard
contents or can be used as a reformatting engine by
assigning text to the variable, %_SL_Text, in the driver
template.
'%-
%-
%IF:'%_SL_FirstTime'='':'%-
%___%IF:"%_SL_Text"="":"%_SL_Text(""%Clipboard; "")"%-
%___%IF:"%_SL_Num_Space"!="":"%-
%______%SetPattRegexp=""(\s{%_SL_Num_Space})""%-
%______%RegExpBlindMatch=""
""%-
%______%_SL_Leading_Space(%SubPatt(1))":"%-
%______%_SL_Leading_Space()"%-
%___%_SL_FirstTime="No"'%-
%-
%IF:'%_SL_Text'!='':'%-
%-
%___%IF:"%_Debug"="1":"In SALUTATIONLIST2, _SL_Text: %_SL_Text
"%-
%___%SetPattRegexp=!(?x)
^\s* # Strip Leading Spaces
( # SubPatt 1 - First Item
( # SubPatt 2 - Name including quotation
# marks if present
(\"?) # Opening Quotation marks
([EMAIL PROTECTED]<]*?) # SubPatt 4 - Name
\3 # Closing Quotation marks if opening ones exist
\s+
)? # Close name including quotation marks
\<?([EMAIL PROTECTED])\>? # SubPatt 5 - Address
) # Close First Item
\s*[;,]\s* # Delimiter and white space
(.*) # SubPatt 6 - Remainder of list
\Z!%-
%___%RegexpBlindMatch(%_SL_Text)%-
%-
%___%_SL_Name_Addr(%SubPatt(1))%-
%___%_SL_Name(%SubPatt(4))%-
%___%_SL_Addr(%SubPatt(5))%-
%___%_SL_Text(%SubPatt(6))%-
%___%IF:"%_Debug"="1":"In SALUTATIONLIST2, _SL_Name_Addr: %_SL_Name_Addr
"%-
%___%IF:"%_Debug"="1":"In SALUTATIONLIST2, _SL_Name : %_SL_Name
"%-
%___%IF:"%_Debug"="1":"In SALUTATIONLIST2, _SL_Addr : %_SL_Addr
"%-
%-
%___%_SL_Leading_Space%-
%TO=""%TO="%_SL_Name_Addr"%-
%QINCLUDE(SALUTATION),%-
%QINCLUDE(SALUTATIONLIST2)'%-
----- [ SALUTATION ]
%IF:"%ABTOEMAIL"="":"%-
%___%IF:'%_Debug'='1':'noab':''%-
%___%QINCLUDE(SALUTATIONNOAB)":"%-
%___%IF:'%_Debug'='1':'ab':''%-
%___%QINCLUDE(SALUTATIONAB)"%-
----- [ SALUTATIONAB ]
%_SL_To='%_SL_To, "%ABTONAME" <%TOADDR>'%-
%ABTOFIRSTNAME%-
----- [ SALUTATIONNOAB ]
%_SL_To="%_SL_To, %TO"%-
%TOFNAME%-
--
Greetings,
Maurice
Windows XP 5.1 Build 2600 Service Pack 2
The Bat! v3.51.4; Bayes Filter Plugin v2.0.3; AJS v0.6; MyMacros
1.11a;
________________________________________________________
http://www.silverstones.com/thebat/TBUDLInfo.html