On Wed 26 May 2004, 4:31:03 +1000, Cyrille wrote:
> Is there a (semi-)automated way to insert such a line in hundreds of AB
> entries?

If the addressbook entries do not already have information in the memo
field, you can select multiple entries, and then Edit->Properties and
select the memo tab to enter the same information in all of them at once.
This will overwrite any existing information in that field though.

> And since reality is more complicated than any theory I guess that I
> will forget sometimes to add this line to each new contact. That is
> why I dream about the following solution:
> 
> When composing a message (new or reply),
> 1) your QT could get the language information from the AB memo field,
> 2) if there is no such info, the recipient's address domain extension
> is used to determine the language,
> 3) if this is not possible (".com" or Slovak using a Czech domain,
> etc.), in this case there should be a possibility to call manually a
> QT (as Miguel Urech described on Saturday in
> mid:[EMAIL PROTECTED])
> And depending on this language information
> 1) %CharSet is defined,
> 2) %Language is defined and
> 3) different text templates are used

I would suggest something based on the following.

Assume for you want to have specific Hungarian, Russian and Czech
language options, and will use English if none of the above apply.


1. Set up a new message template like this:

---- [ New Message Template ]
%QInclude(SetLanguage)


Cyrille
mailto:[EMAIL PROTECTED]
---- [ End New Message Template ]


2. Create SetLanguage QT to select an appropriate language like this

---- [ SetLanguage QT ]
%REM=^%-

Set language based on recipient's addressbook memo entry containing a
line starting "Language:" followed by the language code

If this doesn't exist, use the TLD in the recipient's address

^%-
%-
%_SetLang='%SetPattRegExp="(?im)^Language:\s*[a-z]{2}$"%RegExpMatch=%ABToMemo'
%If:^%_SetLang^<>^^:^%Language=%_SetLang^:^%-
%-
%Rem="No language entry in the addressbook"%-
%-
%_SLDomain='%SetPattRegExp="\.([^\.]*?)$"%RegExpMatch("%ToAddr")%-'
%_SetLang="AM"%-
%-
%If:'%_SLDomain'='cz':'%_SetLang="CZ"'%-
%If:'%_SLDomain'='ru':'%_SetLang="RU"'%-
%If:'%_SLDomain'='hu':'%_SetLang="HU"'%-^
%-
%If:"%_SetLang"="AM":"%QInclude(EN_Template)":%-
%If:"%_SetLang"="CZ":"%QInclude(CZ_Template)":%-
%If:"%_SetLang"="RU":"%QInclude(RU_Template)":%-
%If:"%_SetLang"="HU":"%QInclude(HU_Template)":%-

---- [ End SetLanguage QT ]


3. Set up language templates called EN_Template, HU_Template, RU_Template
and CZ_Template that set up the appropriate attributes. I don't speak
Hungarian, Russian or Czech, so I don't know what greetings or other text
you might want in it, but the English one might simply look like this

----- [ EN_Template QT ]
%Language=AM%-
%CharSet="ISO-8859-1"
%Qinclude(Greet_All_Recipients)

%Cursor

--
Best regards,
----- [ End EN_Template QT ]

Where Greet_All_Recipients is a QT in the library at
http://www.silverstones.com/thebat/Library.html that puts in the first
name of all recipients on the TO list.

So the new message template puts in your name and email address at the
end, and calls the SetLanguage QT to get the right language template.
Then the language template sets the language and charset and language
specific parts of the message.

Now, I haven't checked that it all works precisely as I have set out. I
haven't debugged it, and you would need to create Reply and Forward
message templates in a similar way. However, it shouldn't be too
difficult to do.

Note also that I don't use the %CharSet macro, so I have only guessed
at how it is set.

--
Robin Anson
Using The Bat! v2.04.7 on Windows XP 5.1 Build 2600 Service Pack 1


________________________________________________
Current version is 2.10.03 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to