🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #162243

Re: [dialog] script plonk by name and address

#162243
From: 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 =----
Technical Details
Message-ID: <fl2bosvq2l73.dlg@ID-259643.user.individual.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx01.iad01.newshosting.com!news-out.nuthinbutnews.com!spool9-west!not-for-mail
References: <1iu3rrsrl7b14.dlg@ID-104726.news.individual.net>

Show Full Headers
Complete Article Headers
Message-ID: <fl2bosvq2l73.dlg@ID-259643.user.individual.net>
Subject: Re: [dialog] script plonk by name and address
Date: Tue, 8 Feb 2005 11:43:50 -0500
From: Cold Coffee <not@chance.com>
References: <1iu3rrsrl7b14.dlg@ID-104726.news.individual.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx01.iad01.newshosting.com!news-out.nuthinbutnews.com!spool9-west!not-for-mail
X-Proxy-User: $$xz9ibj-4yq
Newsgroups: news.software.readers
User-Agent: 40tude_Dialog/2.0.15.1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Lines: 151
X-Comments: This message was posted through <A href
X-Comments2: IMPORTANT: Newsfeeds.com does not condone,
X-Report: Please report illegal or inappropriate use to
Organization: Newsfeeds.com http://www.newsfeeds.com 100,
 000+ UNCENSORED Newsgroups.