Hi TBUDL,

On  Wed, 20 Dec 2000  at  07:49:30 GMT -0500 (which was 4:49 AM
where I live) witnesses say Jan Rifkinson typed:

Januk>> %ABnnnPPP="Default value"

Januk>> An example of this is for greetings.  Suppose I want my greeting to
Januk>> say "Hi Chris" when I reply to my friend Christopher, but the full
Januk>> first name if the person isn't in my address book.  I would use:

Januk>> Hi %ABofromFIRSTNAME="%OFROMFNAME"

>   I'm trying to understand the real use of this new macro & how it
>   differs from one of the current name macros.

The new macros pull info from the address book instead of from the
original message.  So continuing the example above, suppose my friend
sends me a message with the from line looking like:

 From: Christopher Friend <[EMAIL PROTECTED]>

If I were just using %OFROMFNAME, I would get:

 Hi Christopher,

However, I if have an address book entry for the address
[EMAIL PROTECTED] , I can use the information I have stored
there.  So now using %ABofromFIRSTNAME, I get:

 Hi Chris,

Where 'Chris' is the first name of the contact in the address book that
matches the address <[EMAIL PROTECTED]>.

Now consider the following, what happens if there is no address book
entry that matches the address?  Well, by supplying a default value,
you get the address book entry if it exists, otherwise you get the
default.  This behaviour can be used with some fancy regular
expressions to come up with some *smart* templates.

Let's extend the current example so that if the person I'm replying to
has an AB entry, I say "Hi Chris,"  and if they don't have an AB
entry, I say "Hello Christopher,".  In this case, you can use the
regular expression:

<one line>
%SETPATTREGEXP="(?(?=Hi\s;;)Hi\s;;(.*)|(.*);;)"%REGEXPMATCH="Hi %ABtoFIRSTNAME;;Hello 
%TOFNAME"%SUBPATT="2",
</one line>

Here we are taking advantage of the fact that the %ABnnnYYY macros
return empty strings if they find no match.

Ok, so now you're thinking, "Well, that's kind of interesting, but
do I really need to waste my time with this?"

I'll give you an example which is a little more powerful.  Consider a
situation where you receive mail where your responses need to be
formal.  This could be your bosses, professors, teachers, etc.  Well,
one way of being formal is to say, "Hello (Mr.|Mrs.|Dr.) Lastname,"

You could do this by creating *specific* address book templates for
each of these people, but who wants to do that?  Instead create a
group template that uses the following syntax for the greeting:

Hello %ABtoNAMEPREFIX%ABtoLASTNAME,

Now you might notice that this particular example I've used the to
address instead of ofrom for the search.  This is something you should
look at for your particular case.  In general, use %ABofromYYY for reply
templates and %ABtoYYY for new message templates.

As a final example, consider the case where your correspondent has a
poorly formatted From line.  Using %ABxxxYYY macros lets you clean up
the mess in a variety of ways automatically.  Suppose your
correspondent replies with one address but prefers you to mail a
different address.  Well, simply use:

%TO=""%TO='"%ABofromNAME=''%OFROMNAME''" <%ABofromEMAIL="%OREPLYADDR">'

This will clean up the To line if you have an entry, otherwise it will
reconstruct it the way TB normally does.

> Is this new macro best used @ the AB level or where?

With the default value option, you can safely use these macros in any
template.  How much you use the macros depends on how unique you make
your templates.

Be warned that the %ABxxxYYY macros give some very weird results if
there are multiple matches for a given address.  So if you're getting
some very unexpected results, check all your address books for
duplicates.

Wow, this turned out to be a long post.  Sorry about that.

-- 
Thanks for writing,
 Januk Aggarwal

 Using The Bat! 1.48d
 under Windows 98 4.10 Build 2222  A 

-- 
--------------------------------------------------------------
View the TBUDL archive at http://tbudl.thebat.dutaint.com
To send a message to the list moderation team double click here:
   <mailto:[EMAIL PROTECTED]>
To Unsubscribe from TBUDL, double click here and send the message:
   <mailto:[EMAIL PROTECTED]>
--------------------------------------------------------------

You are subscribed as : [email protected]


Reply via email to