Re: Reply addressing cleanup macro

2004-04-15 Thread dAniel hAhler
Hello bats,

on Thu, 15. Apr 2004 at 12:26:32 +0200 Krzysztof Kudlacik wrote:

>> You just want to kill more than just one address?
> Yes. I want to remove them from CC list, if they are present.

Try this:
->8
%_s1=''%-
%_newCC=%CCLIST%-
%SETPATTREGEXP='(?i)(yourpattern)'%-
%until("s1", "", "%-
%%RegExpBlindMatch(%%_newCC)%%-
%%_s1=%%SUBPATT(1)%%-
%%IF:'%%_s1'<>'':#%%_newCC='%%_s1'#%%-
")%-
%CC=''%-
%SETPATTREGEXP='(.*?)(\s*,\s*$)'%-
%IF:"RegExpMatch='%_newCC'"<>"":"%CC=%SUBPATT(1)":%-
"%CC=%_newCC"%-
->8

Just apply "yourpattern", eg "[^,^]*(@domain\.tld\s*[,$])". The part in
the round parenthesis is going to be removed.
in case we remove the last address we'll have to make sure to kill the
remaining ',', this is checked after %CC=''.

I did not test this, so there might be some syntax error or even a
infinite loop with the until-part, let me now.. :)

>> Take a look at the MyMacros plugin. It has while() and StrReplace() -
>> both could be used for that.
> :)  thx for your tips, but I am not a programmer - only "end user". Then I
> have to use stuff prepared by others.

I understood.. :o)

Things would be a lot easier if MyMacros' StrReplace would support
RegExps.
Perhaps a good idea to ask the author to implement this, for future
tasks.


-- 
shinE!
GnuPG/PGP key: http://thequod.de/danielhahler.asc
lifted with The Bat! 2.05 Beta/14 on Windows XP Service Pack 1.




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply addressing cleanup macro

2004-04-15 Thread Krzysztof Kudlacik
2004-04-15, I saw:

> You just want to kill more than just one address?

Yes. I want to remove them from CC list, if they are present.

> Take a look at the MyMacros plugin. It has while() and StrReplace() -
> both could be used for that.

:)  thx for your tips, but I am not a programmer - only "end user". Then I
have to use stuff prepared by others.


-- 
pb   _,   )\__/(   ,_ Polska Strona Programu The Bat! |
   /'.;`-.`{..}',-';.`\  http://thebat.pl |
 /'.'; `-,`-""-',-' ;`.`\ The Bat! Polish Support |
 \/\/^\---.\;;/.---/^\/\/   2.04.5/Windows XP |




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply addressing cleanup macro

2004-04-15 Thread dAniel hAhler
Hello bats,

on Thu, 15. Apr 2004 at 09:24:52 +0200 Krzysztof Kudlacik wrote:

>> I'd use a python script for that.
> Hmmm ... :(
> Is  there any other way to obtain this behaviour of TB!? It means: without
> Python?

You just want to kill more than just one address? Take a look at the
MyMacros plugin. It has while() and StrReplace() - both could be used
for that.


-- 
shinE!
GnuPG/PGP key: http://thequod.de/danielhahler.asc
lifted with The Bat! 2.05 Beta/14 on Windows XP Service Pack 1.




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply addressing cleanup macro

2004-04-15 Thread Krzysztof Kudlacik
2004-04-15, I saw:
> I'd use a python script for that.

Hmmm ... :(
Is  there any other way to obtain this behaviour of TB!? It means: without
Python?

-- 
pb   _,   )\__/(   ,_ Polska Strona Programu The Bat! |
   /'.;`-.`{..}',-';.`\  http://thebat.pl |
 /'.'; `-,`-""-',-' ;`.`\ The Bat! Polish Support |
 \/\/^\---.\;;/.---/^\/\/   2.04.5/Windows XP |




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply addressing cleanup macro

2004-04-14 Thread dAniel hAhler
Hello bats,

on Wed, 14. Apr 2004 at 10:39:21 -0700 Januk Aggarwal wrote:

DH>> That's quite powerful.
> That does look good.  If only I didn't have to install a program in
> addition to the plugin...

The plugin simply provides an interface to the other "program". It's a
very powerful scripting language and since I installed it for TheBat I
found many uses for other tasks here.
Even Google is powered by Python.. 8)


-- 
shinE!
GnuPG/PGP key: http://thequod.de/danielhahler.asc
lifted with The Bat! 2.05 Beta/14 on Windows XP Service Pack 1.




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply addressing cleanup macro

2004-04-14 Thread Januk Aggarwal
Hello dAniel,

On Wednesday, April 14, 2004 at 18:19 GMT +0200, a witness saw Daniel
Hahler [DH] commit:

DH> I'd use a python script for that.


Thanks. That's getting close to what I requested. After thinking about
the "intelligent template" requirements that I have, I think I'm going
to have to do a recursive template with a lot of customization. I'm
not sure that a general purpose template will work for this one.

Alright, that's a project for some evening when I have time.

DH> That's quite powerful.

That does look good.  If only I didn't have to install a program in
addition to the plugin...

DH> HTH, I replaced my old CCLIST-killer with this one, too.. :)

That's good, at least you've benefited from this exercise.  :-)

-- 
Thanks for writing,
 Januk Aggarwal





http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply addressing cleanup macro

2004-04-14 Thread Marck D Pearlstone
Dear Eddie,

@14-Apr-2004, 18:30 +0200 (14-Apr 17:30 UK time) Eddie Castelli [EC]
in mid:[EMAIL PROTECTED] said to dAniel:

>> I'd use a python script for that. First you'll need the TBPyxie
>> (http://www.google.com?q=tbpyxie) plugin and can then use
>> something like this:

EC> This returns a 'ERROR not found'! Could/would you send it by PM
EC> please?

http://www.google.com/search?q=tbpyxie is what he meant. It will
lead you here: http://kaishaku.org/software/tbpyxie/

-- 
Cheers -- //.arck D Pearlstone -- List moderator
TB! v2.05 Beta/16 on Windows XP 5.1.2600 Service Pack 1
'

http://www.silverstones.com/thebat/TBUDLInfo.html

Re: Reply addressing cleanup macro

2004-04-14 Thread Eddie Castelli
Dear dAniel,

   -->> Mittwoch, 14. April 2004, 18:19:03:


> I'd use a python script for that. First you'll need the TBPyxie
> (http://www.google.com?q=tbpyxie) plugin and can then use something
> like this:

This returns a 'ERROR not found'! Could/would you send it by PM
please?


-- 
   best regards
www.EddieCastelli.com
   Eddie
  on Tour




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply addressing cleanup macro

2004-04-14 Thread dAniel hAhler
Hello bats,

on Wed, 14. Apr 2004 at 16:13:16 +0200 Krzysztof Kudlacik wrote:

>> I have not exactly what you're looking for, but this is sth that I've
>> put up to kill %FROMADDR from the recipient list (TO + CC) - useful when
>> I reply-to-all and don't want to send it also to myself:
> It works nice ;)
> But  it  has  one disadventage - it kills only one e-mail address which is
> defined in properties of account. It fails if I use also some aliases. Can
> it  be improved to clear also some other aliases not mentioned directly in
> account properties?

I'd use a python script for that.
First you'll need the TBPyxie (http://www.google.com?q=tbpyxie) plugin
and can then use something like this:

->8
%Py("
from re import sub
from string import strip

cclist = '''%CCLIST'''
cclist = '''huibla, [EMAIL PROTECTED], daniel [EMAIL PROTECTED], [EMAIL PROTECTED], 
hoschi, '''

killlist = ['bla', 'oschi']

for kill in killlist:
  cclist = sub( r'[^,^]*' + kill + r'[^,$]*,?', '', cclist )

cclist = strip(cclist, ', ')
")%-
%CC=''%CC='%PYX("cclist")'%-
->8

That's quite powerful.
We put the %CCLIST into a python variable. killlist is a list of strings
that should be killed.
We loop through every string in this list and do a re.sub on that. First
param is a regex pattern to match, second is the replacement and the
third param is the string we want to be replaced.
After looping we strip commas and spaces from cclist, then delete the
old %CC and put the new in there instead.

Please note: the whole thing is very "hungry". everything put into
killlist will kill an address, if it's in there. So if you want to kill
every address on a specific domain you should set killlist =
['@domain.tld'].

btw: the 'r' in front of a string simply means: raw string, so
backslashes won't be replaced. I think we would not need it here, but
for regexps you should always use raw strings.

HTH, I replaced my old CCLIST-killer with this one, too.. :)


-- 
shinE!
GnuPG/PGP key: http://thequod.de/danielhahler.asc
lifted with The Bat! 2.05 Beta/14 on Windows XP Service Pack 1.




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply addressing cleanup macro

2004-04-14 Thread Krzysztof Kudlacik
2004-04-14, I saw:

> I have not exactly what you're looking for, but this is sth that I've
> put up to kill %FROMADDR from the recipient list (TO + CC) - useful when
> I reply-to-all and don't want to send it also to myself:

It works nice ;)
But  it  has  one disadventage - it kills only one e-mail address which is
defined in properties of account. It fails if I use also some aliases. Can
it  be improved to clear also some other aliases not mentioned directly in
account properties?

-- 
pb   _,   )\__/(   ,_ Polska Strona Programu The Bat! |
   /'.;`-.`{..}',-';.`\  http://thebat.pl |
 /'.'; `-,`-""-',-' ;`.`\ The Bat! Polish Support |
 \/\/^\---.\;;/.---/^\/\/   2.04.5/Windows XP |




http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Reply addressing cleanup macro

2004-04-14 Thread dAniel hAhler
Hello bats,

on Tue, 13. Apr 2004 at 13:49:10 -0700 Januk Aggarwal wrote:

> If not, I'll write my own, but I thought I'd check here before wasting
> the hour or two.

I have not exactly what you're looking for, but this is sth that I've
put up to kill %FROMADDR from the recipient list (TO + CC) - useful when
I reply-to-all and don't want to send it also to myself:

->8
%REM="___kill %FROMADDR from CCLIST; for reply-to-all"%-
%SETPATTREGEXP='(.*)?((,|^).*%FROMADDR[^\w]*)(.*)?'%-
%REGEXPBLINDMATCH='%CCLIST'%-
%IF:%SUBPATT='0'<>"":"%CC=''%CC=%SUBPATT='1'":''%-
%IF:%SUBPATT='4'<>"":"%CC=%SUBPATT='4'":''%-
%-
->8


-- 
shinE!
GnuPG/PGP key: http://thequod.de/danielhahler.asc
lifted with The Bat! 2.05 Beta/14 on Windows XP Service Pack 1.




http://www.silverstones.com/thebat/TBUDLInfo.html


Reply addressing cleanup macro

2004-04-13 Thread Januk Aggarwal
Hi,

I am looking for a reply addressing cleanup template that can remove
my addresses from the address fields.

I want to remove most addresses from my domain but there are a couple
of users on my domain whose addresses should not be removed. I suppose
the macro should ensure that it isn't removing the last address from
the list in case I'm intentionally sending myself messages between
accounts. I also suppose that the macro should be somewhat intelligent
about keeping the To and CC lists sensible.

As I recall (though I couldn't find it in the repository), some people
are using a relatively simple regexp for part of the job. I don't
think that my requirements can be met by a single simple regexp, but I
was wondering if anyone had come up with a fancier solution?

If not, I'll write my own, but I thought I'd check here before wasting
the hour or two.

-- 
Thanks,
 Januk Aggarwal




http://www.silverstones.com/thebat/TBUDLInfo.html