🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
12 messages
12 total messages Started by Jim Scott Tue, 08 Feb 2005 16:25
[dialog] script plonk by name and address
#162241
Author: Jim Scott
Date: Tue, 08 Feb 2005 16:25
9 lines
1447 bytes
I cut and pasted a script that, I thought, allowed me to plonk using the
name *and* the address of the sender.
However it doesn't work and I may have made a mess of it. However I cannot
find the original. Can someone please direct me to it, or post one here?
TIA
-- 
Jim on Tyneside UK
Remove X to email me.
http://freespace.virgin.net/mr.jimscott/
Re: [dialog] script plonk by name and address
#162243
Author: Cold Coffee
Date: Tue, 08 Feb 2005 16:43
151 lines
4418 bytes
On Tue, 8 Feb 2005 16:25:14 +0000, Jim Scott wrote:

> I cut and pasted a script that, I thought, allowed me to plonk using the
> name *and* the address of the sender.
> However it doesn't work and I may have made a mess of it. However I cannot
> find the original. Can someone please direct me to it, or post one here?


Here is the original script that the author (not me) posted to this group
about three weeks ago:

I copied and pasted the script exactly as he posted under the custom
scripts, then assigned a shortcut key and menu icon.  It works well for me.



---------   begin script --------------------------------

Program PlonkWithAddress;  //v0.4 24/Gennaio/2005, by MLC
uses Forms, StdCtrls;

var
 myForm: TForm;
 myMemo: TMemo;
 mail: string;

Function EmptyClipboard:boolean; external 'EmptyClipboard@user32.dll
stdcall';
Function OpenClipboard(hWndNewOwner: INTEGER):boolean; external
'OpenClipboard@user32.dll stdcall';
Function CloseClipboard:boolean; external 'CloseClipboard@user32.dll
stdcall';

function ItemCount(s: string; sep: char): integer;
var
 i, r: integer;
 stemp: string;
begin
  stemp:=s;
  r:=0;
  i:=Pos(sep,stemp);
  while i<>0 do
  begin
   r:=r+1;
   delete(stemp, i, 1);
   i:=Pos(sep,stemp);  
  end;
  result:=r;     
end;

function RevStr(s: string ): string;
var
  i: integer;
  s2: string;
begin
  s2 := '';
  for i:=1 to Length(s) do
  begin
    s2:=s[i]+s2;
  end;
  result:=s2;
end;

Procedure ClearClipboard;
Begin
 OpenClipboard(0);
 EmptyClipboard;
 CloseClipboard;
end;

Procedure GetMsgBody;
begin
 ClearClipboard;
 myMemo.Clear;
 ADo('ArticlePane');
 ADo('SelectAll');
 Ado('Copy');
 myMemo.PasteFromClipboard;
end;

Function GetAddress: string;
var 
 i: integer;
 addr: string;
begin
 i:=0;
 addr:='';
 while (i < myMemo.Lines.count-1) do
 begin
  if Pos('From:', myMemo.lines.Strings[i]) = 1 then
  begin
   addr:=myMemo.lines.Strings[i];
   break;
  end
  else i:=i+1;
 end; //while
 i:=ItemCount(addr, '<');
 if (i > 0) then 
 begin
  addr:=RevStr(addr);
  i:=Pos('<',addr);
  addr:=copy(addr, 1, i);
  addr:=RevStr(addr);
 end else addr:='';
 result:=addr;
end;

Procedure BuildContainers;
begin
 myMemo := tMemo.Create(myForm);
 myMemo.Parent := myForm;
 myMemo.Width := Application.Mainform.width;
end;

Begin
  myForm := tForm.Create(nil);
  lockdisplay;
  try
   BuildContainers;
   ADo('ShowHeaders');
   GetMsgBody;
   ADo('ShowHeaders');
   mail:=GetAddress;
   if (mail='') then myMemo.text:=' '
    else myMemo.text:=' +"'+mail+'"';
   myMemo.SelectAll;
   myMemo.CopyToClipboard;
   ADoLater('AddPlonkFilter');
   PostKey(35, false, false, false, false, false, false, false, false);
//end
   PostKey(86, false, false, true, false, false, false, false, false);
//Ctrl+V 
  finally
   unlockdisplay;
   myForm.free;
  end;
End.

-------------------- end script -------------------------

-- 
cc






----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Re: [dialog] script plonk by name and address
#162246
Author: Jim Scott
Date: Tue, 08 Feb 2005 16:51
149 lines
4877 bytes
On Tue, 8 Feb 2005 11:43:50 -0500, Cold Coffee wrote:

> On Tue, 8 Feb 2005 16:25:14 +0000, Jim Scott wrote:
> 
>> I cut and pasted a script that, I thought, allowed me to plonk using the
>> name *and* the address of the sender.
>> However it doesn't work and I may have made a mess of it. However I cannot
>> find the original. Can someone please direct me to it, or post one here?
> 
> 
> Here is the original script that the author (not me) posted to this group
> about three weeks ago:
> 
> I copied and pasted the script exactly as he posted under the custom
> scripts, then assigned a shortcut key and menu icon.  It works well for me.
> 
> 
> 
> ---------   begin script --------------------------------
> 
> Program PlonkWithAddress;  //v0.4 24/Gennaio/2005, by MLC
> uses Forms, StdCtrls;
> 
> var
>  myForm: TForm;
>  myMemo: TMemo;
>  mail: string;
> 
> Function EmptyClipboard:boolean; external 'EmptyClipboard@user32.dll
> stdcall';
> Function OpenClipboard(hWndNewOwner: INTEGER):boolean; external
> 'OpenClipboard@user32.dll stdcall';
> Function CloseClipboard:boolean; external 'CloseClipboard@user32.dll
> stdcall';
> 
> function ItemCount(s: string; sep: char): integer;
> var
>  i, r: integer;
>  stemp: string;
> begin
>   stemp:=s;
>   r:=0;
>   i:=Pos(sep,stemp);
>   while i<>0 do
>   begin
>    r:=r+1;
>    delete(stemp, i, 1);
>    i:=Pos(sep,stemp);  
>   end;
>   result:=r;     
> end;
> 
> function RevStr(s: string ): string;
> var
>   i: integer;
>   s2: string;
> begin
>   s2 := '';
>   for i:=1 to Length(s) do
>   begin
>     s2:=s[i]+s2;
>   end;
>   result:=s2;
> end;
> 
> Procedure ClearClipboard;
> Begin
>  OpenClipboard(0);
>  EmptyClipboard;
>  CloseClipboard;
> end;
> 
> Procedure GetMsgBody;
> begin
>  ClearClipboard;
>  myMemo.Clear;
>  ADo('ArticlePane');
>  ADo('SelectAll');
>  Ado('Copy');
>  myMemo.PasteFromClipboard;
> end;
> 
> Function GetAddress: string;
> var 
>  i: integer;
>  addr: string;
> begin
>  i:=0;
>  addr:='';
>  while (i < myMemo.Lines.count-1) do
>  begin
>   if Pos('From:', myMemo.lines.Strings[i]) = 1 then
>   begin
>    addr:=myMemo.lines.Strings[i];
>    break;
>   end
>   else i:=i+1;
>  end; //while
>  i:=ItemCount(addr, '<');
>  if (i > 0) then 
>  begin
>   addr:=RevStr(addr);
>   i:=Pos('<',addr);
>   addr:=copy(addr, 1, i);
>   addr:=RevStr(addr);
>  end else addr:='';
>  result:=addr;
> end;
> 
> Procedure BuildContainers;
> begin
>  myMemo := tMemo.Create(myForm);
>  myMemo.Parent := myForm;
>  myMemo.Width := Application.Mainform.width;
> end;
> 
> Begin
>   myForm := tForm.Create(nil);
>   lockdisplay;
>   try
>    BuildContainers;
>    ADo('ShowHeaders');
>    GetMsgBody;
>    ADo('ShowHeaders');
>    mail:=GetAddress;
>    if (mail='') then myMemo.text:=' '
>     else myMemo.text:=' +"'+mail+'"';
>    myMemo.SelectAll;
>    myMemo.CopyToClipboard;
>    ADoLater('AddPlonkFilter');
>    PostKey(35, false, false, false, false, false, false, false, false);
> //end
>    PostKey(86, false, false, true, false, false, false, false, false);
> //Ctrl+V 
>   finally
>    unlockdisplay;
>    myForm.free;
>   end;
> End.
> 
> -------------------- end script -------------------------

Thanks CC, that's the one and I got it right.
How do I assign a shortcut key and a menu item to a *script*?
I know, in general terms, how to assign shortcuts to things already there.
-- 
Jim on Tyneside UK
Remove X to email me.
http://freespace.virgin.net/mr.jimscott/
Re: [dialog] script plonk by name and address
#162244
Author: Gember Breuk
Date: Tue, 08 Feb 2005 16:53
19 lines
1735 bytes
On Tue, 8 Feb 2005 16:25:14 +0000, Jim Scott wrote:

> I cut and pasted a script that, I thought, allowed me to plonk using the
> name *and* the address of the sender.
> However it doesn't work and I may have made a mess of it. However I cannot
> find the original. Can someone please direct me to it, or post one here?
> TIA

When you copy the script from Cold Coffe's post, make sure these lines
are not wrapped:

Function EmptyClipboard:boolean; external 'EmptyClipboard@user32.dll stdcall';

Function OpenClipboard(hWndNewOwner: INTEGER):boolean; external 'OpenClipboard@user32.dll stdcall';

Function CloseClipboard:boolean; external 'CloseClipboard@user32.dll stdcall';

-- 
Gem
Re: [dialog] script plonk by name and address
#162245
Author: Jim Scott
Date: Tue, 08 Feb 2005 17:07
26 lines
2242 bytes
On Tue, 8 Feb 2005 11:53:42 -0500, Gember Breuk wrote:

> On Tue, 8 Feb 2005 16:25:14 +0000, Jim Scott wrote:
> 
>> I cut and pasted a script that, I thought, allowed me to plonk using the
>> name *and* the address of the sender.
>> However it doesn't work and I may have made a mess of it. However I cannot
>> find the original. Can someone please direct me to it, or post one here?
>> TIA
> 
> When you copy the script from Cold Coffe's post, make sure these lines
> are not wrapped:
> 
> Function EmptyClipboard:boolean; external 'EmptyClipboard@user32.dll stdcall';
> 
> Function OpenClipboard(hWndNewOwner: INTEGER):boolean; external 'OpenClipboard@user32.dll stdcall';
> 
> Function CloseClipboard:boolean; external 'CloseClipboard@user32.dll stdcall';

Yep I did that, but thought it would work automatically when I used the
plonk rule. Obviously it does not so I would like to allocate it to work
with <P> in the way that Xnews does.
-- 
Jim on Tyneside UK
Remove X to email me.
http://freespace.virgin.net/mr.jimscott/
Re: [dialog] script plonk by name and address
#162249
Author: Gember Breuk
Date: Tue, 08 Feb 2005 17:51
32 lines
2412 bytes
On Tue, 8 Feb 2005 17:07:13 +0000, Jim Scott wrote:

> On Tue, 8 Feb 2005 11:53:42 -0500, Gember Breuk wrote:
> 
>> On Tue, 8 Feb 2005 16:25:14 +0000, Jim Scott wrote:
>> 
>>> I cut and pasted a script that, I thought, allowed me to plonk using the
>>> name *and* the address of the sender.
>>> However it doesn't work and I may have made a mess of it. However I cannot
>>> find the original. Can someone please direct me to it, or post one here?
>>> TIA
>> 
>> When you copy the script from Cold Coffe's post, make sure these lines
>> are not wrapped:
>> 
>> Function EmptyClipboard:boolean; external 'EmptyClipboard@user32.dll stdcall';
>> 
>> Function OpenClipboard(hWndNewOwner: INTEGER):boolean; external 'OpenClipboard@user32.dll stdcall';
>> 
>> Function CloseClipboard:boolean; external 'CloseClipboard@user32.dll stdcall';
> 
> Yep I did that, but thought it would work automatically when I used the
> plonk rule. Obviously it does not so I would like to allocate it to work
> with <P> in the way that Xnews does.

Ah! Ok then, click on "Settings", "Configure buttons/shortcuts...",
and then select "Scripts" in the "Categories" box. Select the script
name you want in the "Command" box, and then press the shortcut key
you want to use for it. 

-- 
Gem
Re: [dialog] script plonk by name and address
#162251
Author: Jim Scott
Date: Tue, 08 Feb 2005 17:58
12 lines
1795 bytes
> Ah! Ok then, click on "Settings", "Configure buttons/shortcuts...",
> and then select "Scripts" in the "Categories" box. Select the script
> name you want in the "Command" box, and then press the shortcut key
> you want to use for it.

Thanks. I didn't read the 'Scripts' option at the bottom. 
Doh!
-- 
Jim on Tyneside UK
Remove X to email me.
http://freespace.virgin.net/mr.jimscott/
Re: [dialog] script plonk by name and address
#162252
Author: Gember Breuk
Date: Tue, 08 Feb 2005 18:01
14 lines
1682 bytes
On Tue, 8 Feb 2005 17:58:13 +0000, Jim Scott wrote:

>> Ah! Ok then, click on "Settings", "Configure buttons/shortcuts...",
>> and then select "Scripts" in the "Categories" box. Select the script
>> name you want in the "Command" box, and then press the shortcut key
>> you want to use for it.
> 
> Thanks. I didn't read the 'Scripts' option at the bottom. 
> Doh!

You're welcome! I'm happy it is working for you. :-)

-- 
Gem
Re: [dialog] script plonk by name and address
#162260
Author: MLC
Date: Tue, 08 Feb 2005 20:27
41 lines
2894 bytes
_Jim Scott_, martedì 08/feb/2005:

>> Ah! Ok then, click on "Settings", "Configure buttons/shortcuts...",
>> and then select "Scripts" in the "Categories" box. Select the script
>> name you want in the "Command" box, and then press the shortcut key
>> you want to use for it.
> 
> Thanks. I didn't read the 'Scripts' option at the bottom. 
> Doh!

Hi Jim,
since you can't find my original post, I copy here the notes I made about
the script, they're important to avoid possible bad effects.

Notes:
- This script doesn't check if you currently have the headers visible or
not, but: if they are not visible, it does its job and adds the address, if
instead they are visible it adds only the nickname (Dialog default).
- Some people use a nickname which is itself an email address: when only
that appears in the From: header, only that is added.
- A malformed address that in the headers doesn't start with a < is not
added.

More Important Notes:
- Don't compile the script with F9 (or clicking on the green triangle), but
compile it with Ctr+F9 (or clicking on the gray little sheet with 10101, on
the left of the green triangle) and then run it _outside_ the script editor,
with a hotkey or a dedicated button.  
- Don't use the Ctrl key in your hotkey combination: the script wouldn't
work well.
- The script uses the Postkey() function to send the "end" and "Ctrl+V"
keystrokes to the "Score and actions" window: so be aware of that, if you
have changed these keys to something else.


The script can be found here:
http://fido.altervista.org/Dialog/script/PlonkWithAddress.html

Ciao,
-- 
Maria Luisa C - 08/02/2005 21.07.37
Re: [dialog] script plonk by name and address
#162262
Author: Jim Scott
Date: Tue, 08 Feb 2005 20:29
47 lines
3340 bytes
On Tue, 8 Feb 2005 21:27:54 +0100, MLC wrote:

> _Jim Scott_, martedì 08/feb/2005:
> 
>>> Ah! Ok then, click on "Settings", "Configure buttons/shortcuts...",
>>> and then select "Scripts" in the "Categories" box. Select the script
>>> name you want in the "Command" box, and then press the shortcut key
>>> you want to use for it.
>> 
>> Thanks. I didn't read the 'Scripts' option at the bottom. 
>> Doh!
> 
> Hi Jim,
> since you can't find my original post, I copy here the notes I made about
> the script, they're important to avoid possible bad effects.
> 
> Notes:
> - This script doesn't check if you currently have the headers visible or
> not, but: if they are not visible, it does its job and adds the address, if
> instead they are visible it adds only the nickname (Dialog default).
> - Some people use a nickname which is itself an email address: when only
> that appears in the From: header, only that is added.
> - A malformed address that in the headers doesn't start with a < is not
> added.
> 
> More Important Notes:
> - Don't compile the script with F9 (or clicking on the green triangle), but
> compile it with Ctr+F9 (or clicking on the gray little sheet with 10101, on
> the left of the green triangle) and then run it _outside_ the script editor,
> with a hotkey or a dedicated button.  
> - Don't use the Ctrl key in your hotkey combination: the script wouldn't
> work well.
> - The script uses the Postkey() function to send the "end" and "Ctrl+V"
> keystrokes to the "Score and actions" window: so be aware of that, if you
> have changed these keys to something else.
> 
> 
> The script can be found here:
> http://fido.altervista.org/Dialog/script/PlonkWithAddress.html
> 
> Ciao,

Thanks. All done and working.
-- 
Jim on Tyneside UK
Remove X to email me.
http://freespace.virgin.net/mr.jimscott/
Re: [dialog] script plonk by name and address
#162375
Author: RJB
Date: Thu, 10 Feb 2005 16:27
17 lines
1474 bytes
On Tue, 8 Feb 2005 21:27:54 +0100, MLC wrote:

<snip>
> The script can be found here:
> http://fido.altervista.org/Dialog/script/PlonkWithAddress.html
> 
> Ciao,
Maria,

Why not post it on the Wiki? <g>

-- 
RJB
2/10/2005 11:25:29 AM

Si vis pacem, para bellum - If you want peace, prepare for war
--Latin Saying
Re: [dialog] script plonk by name and address
#162955
Author: MLC
Date: Fri, 18 Feb 2005 14:10
20 lines
1830 bytes
_RJB_, giovedì 10/feb/2005:

> On Tue, 8 Feb 2005 21:27:54 +0100, MLC wrote:
> 
> <snip>
>> The script can be found here:
>> http://fido.altervista.org/Dialog/script/PlonkWithAddress.html
>> 
>> Ciao,
> Maria,
> 
> Why not post it on the Wiki? <g>

OK, I'm ten days late, but I've done it ^__^ :

http://www.40tude.com/dialog/wiki/index.php/PlonkWithAddress

Ciao,
-- 
Maria Luisa C - 18/02/2005 14.40.52
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads