🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
18 messages
18 total messages Started by Bo Stevens Thu, 18 Dec 2003 21:04
Default posting server for Dialog
#139512
Author: Bo Stevens
Date: Thu, 18 Dec 2003 21:04
7 lines
1322 bytes
This seems like something that Dialog should be able to do with a script.  
Is there a list of all the available Ado('') type functions?  I would like
to try writing this into a script but I would be nice to have some
documentation.

Thanks
Bo
Re: Default posting server for Dialog
#139552
Author: MLC
Date: Fri, 19 Dec 2003 09:09
37 lines
2309 bytes
Il 18/dic/2003 Bo Stevens ha scritto:

> This seems like something that Dialog should be able to do with a script.  
> Is there a list of all the available Ado('') type functions?  I would like
> to try writing this into a script but I would be nice to have some
> documentation.
>
 
I've made a script to create a text file with the list of all the available
actions. Every row contains Caption-Category-Name values; the value you'll
put inside an Ado is the Name value.
_Change_ the constant "filename" with the path of your choice.
If the file is successfully created, you'll hear a bip.
Hope this helps.

Program MyActionList;
const
filename = 'C:\Programmi\40tude Dialog\actions.txt';
var
myString: string;
list: TStringList;

Begin
list := TStringList.Create();
myString:=GetActionList;

try
list.add(myString);
list.SaveToFile(filename);
beep
finally
list.free;
end;
End.
-- 
Maria Luisa C - 19/12/2003 9.50.27, here.
http://fido.altervista.org/
Re: Default posting server for Dialog
#139553
Author: Jeff Relf
Date: Fri, 19 Dec 2003 11:55
25 lines
1802 bytes
Hello MLC ,  You show ,
> Program MyActionList;
> const
> filename = 'C:\Programmi\40tude Dialog\actions.txt';
> var
> myString: string;
> list: TStringList;
> 
> Begin
> list := TStringList.Create();
> myString:=GetActionList;
> 
> try
> list.add(myString);
> list.SaveToFile(filename);
> beep
> finally
> list.free;
> end;
> End.

Thank you .

I wish a script could pass a  Message-ID  to FindMessageID ,
  and then do without the dialog box ...  Oh well .
Re: Default posting server for Dialog
#139558
Author: MLC
Date: Fri, 19 Dec 2003 13:21
15 lines
1788 bytes
Il 19/dic/2003 Jeff Relf ha scritto:

> Thank you .

You're welcome.

> I wish a script could pass a  Message-ID  to FindMessageID ,
>   and then do without the dialog box ...  Oh well .

Is your aim to obtain the parent message?
(I've read your other posts)
I'll think about it, but it doesn't seem easy.
-- 
Maria Luisa C - 19/12/2003 14.13.14, here.
http://fido.altervista.org/
Re: Default posting server for Dialog
#139561
Author: Gember Breuk
Date: Fri, 19 Dec 2003 14:17
18 lines
1777 bytes
On Fri, 19 Dec 2003 10:09:31 +0100, MLC wrote:

[...]
> I've made a script to create a text file with the list of all the available
> actions. Every row contains Caption-Category-Name values; the value you'll
> put inside an Ado is the Name value.
> _Change_ the constant "filename" with the path of your choice.
> If the file is successfully created, you'll hear a bip.
> Hope this helps.
> 
> Program MyActionList;
[...]
> End.

A very nice tool, Maria. Thank you for making it!

-- 
Gem
Re: Default posting server for Dialog
#139563
Author: MLC
Date: Fri, 19 Dec 2003 14:26
12 lines
1683 bytes
Il 19/dic/2003 Gember Breuk ha scritto:

>> Program MyActionList;
> [...]
>> End.
> 
> A very nice tool, Maria. Thank you for making it!

:) Thank you too!
-- 
Maria Luisa C - 19/12/2003 15.25.34, here.
http://fido.altervista.org/
Re: Default posting server for Dialog
#139566
Author: Jeff Relf
Date: Fri, 19 Dec 2003 14:54
10 lines
1679 bytes
Hello MLC ,  You ask ,
" Is your aim to obtain the parent message ? "

Yes ,  I'd like single key access to the parent post .
( Because I mostly use an  unread / unthreaded  view )

You say :
" I'll think about it ,  but it doesn't seem easy "

Are you saying that it's  Possible  to do ?
Re: Default posting server for Dialog
#139600
Author: MLC
Date: Sat, 20 Dec 2003 08:55
27 lines
2481 bytes
Il 19/dic/2003 Jeff Relf ha scritto:

> Hello MLC ,  You ask ,
> " Is your aim to obtain the parent message ? "
> 
> Yes ,  I'd like single key access to the parent post .
> ( Because I mostly use an  unread / unthreaded  view )
> 
> You say :
> " I'll think about it ,  but it doesn't seem easy "
> 
> Are you saying that it's  Possible  to do ?

Yep. I've been working on it for a while, but I'm still not able to send
the content of the clipboard to the Find Message-ID window via script.
I've tried with
PostKey(Ord('V'),false,false,true,false,false,false,false,false);
to simulate a Ctrl-V, but it doesn't work.

So, until now my script works only this way:
you press the hotkey assigned to it (backspace for example) and then you
press Ctrl-V and Enter.
You'll have the parent message, but it is a "three keys access", not a
"single key access".  :(
-- 
Maria Luisa C - 20/12/2003 9.18.20, here.
http://fido.altervista.org/
Re: Default posting server for Dialog
#139601
Author: Jeff Relf
Date: Sat, 20 Dec 2003 11:29
16 lines
1959 bytes
Hello MLC ,  You wrote ,
" I've tried with
    PostKey( Ord( 'V'),false,false,true,
      false,false,false,false,false );
  to simulate a Ctrl-V ,  but it doesn't work "

Yes ,  When your script calls the  Find Message-ID  dialog ,
   the script is left behind 
   and you enter an entirely different event loop .
   ( i.e.  The dialog is  " Modal " )

The backspace key !  That's a good choice .

I'd love a copy of that script ,
  if you would be so kind .
Re: Default posting server for Dialog
#139605
Author: MLC
Date: Sat, 20 Dec 2003 11:53
153 lines
5336 bytes
Il 20/dic/2003 Jeff Relf ha scritto:

> I'd love a copy of that script ,
>   if you would be so kind .

Gladly.
Here it is:

Program GoToParent;
uses
   Forms,
   StdCtrls;
var
   myForm: TForm;
   myMemo: TMemo;
   Refs: string;
   ParentID: 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';

   PROCEDURE ClearCLipboard;
   BEGIN
      OpenClipboard(0);
      EmptyClipboard;
      CloseClipboard;
   END;

   PROCEDURE GetMessageBody (var LocMymemo: tMemo);
   BEGIN
      LocMyMemo.Clear;
      ClearCLipboard;
      ADo('ArticlePane');
      ADo('SelectAll');
      Ado('Copy');
      LocMyMemo.PasteFromClipboard;
   END;

   FUNCTION RefsExtract( HeaderTag: String; var LocMymemo: tmemo): string;
   var
      index : integer;
      allrefs: string;
   BEGIN
      index := 0;
      allrefs := '';
      WHILE (index < LocMymemo.Lines.count-1) AND (allrefs = '') DO
      BEGIN
         IF POS(HeaderTag,LocMymemo.lines.Strings[index]) = 1 THEN
         BEGIN
            allrefs := LocMymemo.lines.Strings[index];
            index := index+1;
            WHILE (index < LocMymemo.Lines.count-1)
            AND (POS('<',LocMymemo.lines.Strings[index])=1) DO
            BEGIN
             allrefs := allrefs + LocMymemo.lines.Strings[index];
             index := index+1;
            END
         END
         index := index+1;
      END;
      result:=allrefs;
   END;

   FUNCTION GetHeaderInfo(HeaderTag : string; var LocMymemo : tMemo):
string;

   BEGIN
      Result := RefsExtract(HeaderTag, LocMymemo);
      delete(Result, 1, length(HeaderTag));
   END;


   FUNCTION GetRefs(var LocMymemo : tMemo): string;
   begin
      result := GetHeaderInfo('References: ', LocMymemo);
   end;
   
   FUNCTION GetParent(var LocRefs: string): string;
   var
      tag: string;
      index: integer;
      posiz, lung : integer;
   begin
     tag := '<';
     index := length(LocRefs)-1;
     result := '';
     posiz := 0;
     while (index > 0) and (posiz = 0) do
     begin
       if Pos(tag, LocRefs[index])=0 then
         index:=index-1
       else
         posiz := index;
       lung:=length(LocRefs)-posiz+1;
       result := copy(LocRefs, posiz, lung);
     end
   end;

   FUNCTION AreHeadersHidden(var LocMymemo : tMemo): boolean;
   var
      index: integer;
      temp: boolean;
   BEGIN
      temp := true;
      IF LocMyMemo.Lines.count > 10 THEN
      BEGIN
         index := 0;
         WHILE (Index < LocMyMemo.Lines.count -1) and temp DO
         BEGIN
            index := index+1;
            temp := Pos('Newsgroups: ', LocMyMemo.Lines.strings[index]) =
0;
         END;
      END;
      result := temp;
   END;       

Begin
   myForm := tForm.Create(nil);
   myForm.width:=800;
   myForm.Height:=600;
   myMemo := tMemo.Create(myForm);
   myMemo.Parent := myForm;
   myMemo.Width := myForm.width;
   myMemo.Height := myForm.Height;
   try
   GetMessageBody(myMemo);
   if AreHeadersHidden(myMemo) then
      ADo('ShowHeaders');
   GetMessageBody(myMemo);
   Refs := GetRefs(myMemo);
   myMemo.Clear;
   myMemo.Lines.Add(Refs);
   ParentID := GetParent(Refs);
   ClearClipboard;
   myMemo.Clear;
   myMemo.Lines.Add(ParentID);
   myMemo.SelectAll;
   myMemo.CopyToClipboard;
   if AreHeadersHidden(myMemo) then
     ADo('ShowHeaders');
   finally
   myform.free;
   Ado('FindMessageID');
   end;
End.
-- 
Maria Luisa C - 20/12/2003 12.49.23, here.
http://fido.altervista.org/
Re: Default posting server for Dialog
#139606
Author: Jeff Relf
Date: Sat, 20 Dec 2003 12:14
11 lines
1869 bytes
Hello MLC ,  Re:  You're GoToParent script ,  You wrote ,
" Gladly .  Here it is ... "

Wow ,  Thanks ,  that was fast !  You're too kind .

I'm sure I'll get plenty of use out of it .

And the script looks interesting too .

P.S.  I had to unwrap a couple of long lines ,
        no big deal .
Re: Default posting server for Dialog
#139607
Author: MLC
Date: Sat, 20 Dec 2003 12:24
10 lines
1880 bytes
Il 20/dic/2003 Jeff Relf ha scritto:

> Wow ,  Thanks ,  that was fast !  You're too kind .
> 
> I'm sure I'll get plenty of use out of it .

You're welcome :)
-- 
Maria Luisa C - 20/12/2003 13.24.25, here.
http://fido.altervista.org/
Re: Default posting server for Dialog
#139608
Author: Jeff Relf
Date: Sat, 20 Dec 2003 12:54
4 lines
1876 bytes
Hello MLC ,  You wrote , " You're welcome :) "

I just tested it again using this last message of yours ,
  it worked great ...  Thanks again .
Re: Default posting server for Dialog
#139614
Author: Enrico C
Date: Sat, 20 Dec 2003 16:13
19 lines
2273 bytes
Jeff Relf | news.software.readers
in <news:pf08pk61akny.dlg@__.Jeff.Relf>

> Hello MLC ,  You wrote , " You're welcome :) "
> 
> I just tested it again using this last message of yours ,
>   it worked great ...  Thanks again .

It works fine here too :)
(I just had to fix some linebreaks after I copy&pasted the script)

Well done Maria Luisa!!
I've bene longing for that for a long time :)

-- 
Enrico C

| 40tude Dialog Italy Cafe
| http://www.lillathedog.net/dialog/
Re: Default posting server for Dialog
#139616
Author: Enrico C
Date: Sat, 20 Dec 2003 16:20
21 lines
2205 bytes
MLC | news.software.readers
in <news:1m94fm1vlkaa7.dlg@ID-187316.user.uni-berlin.de>

> So, until now my script works only this way:
> you press the hotkey assigned to it (backspace for example) and then you
> press Ctrl-V and Enter.

That's easier than navigate the header references, anyway :)

I noticed a little problem, though: the Get Message-ID script (I have
assigned it to Ctrl-Shift-G)  doesn't work any more now :(
It just gives "<news:> as a result, the M-ID is missing!

If I delete the compiled version of GoToParent, then GetMID works
again. 

-- 
Enrico C

| 40tude Dialog Italy Cafe
| http://www.lillathedog.net/dialog/
Re: Default posting server for Dialog
#139621
Author: MLC
Date: Sat, 20 Dec 2003 17:33
22 lines
2511 bytes
Il 20/dic/2003 Enrico C ha scritto:

> That's easier than navigate the header references, anyway :)
> 
> I noticed a little problem, though: the Get Message-ID script (I have
> assigned it to Ctrl-Shift-G)  doesn't work any more now :(
> It just gives "<news:> as a result, the M-ID is missing!
> 
> If I delete the compiled version of GoToParent, then GetMID works
> again.

Ditto here :(
It's a mystery how two scripts can interfere each other this way.
I've used the GetMessageBody, ClearClipboard, GetHeaderInfo, and
AreHeadersHidden of the other script (with some little changement), then
I've added the functions GetRefs and GetParent. Maybe Dialog, loading both
the scripts in memory, doesn't like having functions with the same name but
working a little differently.
Now I'll try changing the names. I'll let you know.
-- 
Maria Luisa C - 20/12/2003 18.16.37, here.
http://fido.altervista.org/
Re: Default posting server for Dialog
#139625
Author: MLC
Date: Sat, 20 Dec 2003 17:49
147 lines
5069 bytes
Il 20/dic/2003 MLC ha scritto:

> Now I'll try changing the names. I'll let you know.

Done! Now they work both.
This is the new version (beta 0.2 ? LOL!)

Program GoToParent;
uses
   Forms,
   StdCtrls;
var
   myForm: TForm;
   myMemo: TMemo;
   Refs: string;
   ParentID: 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';

PROCEDURE ClearCLipboard;
BEGIN
 OpenClipboard(0);
 EmptyClipboard;
 CloseClipboard;
END;

PROCEDURE GetMessBody (var LocMymemo: tMemo);
BEGIN
 LocMyMemo.Clear;
 ClearCLipboard;
 ADo('ArticlePane');
 ADo('SelectAll');
 Ado('Copy');
 LocMyMemo.PasteFromClipboard;
END;

FUNCTION RefsExtract( HeaderTag: String; var LocMymemo: tmemo): string;
var
 index : integer;
 allrefs: string;
BEGIN
 index := 0;
 allrefs := '';
 WHILE (index < LocMymemo.Lines.count-1) AND (allrefs = '') DO
 BEGIN
   IF POS(HeaderTag,LocMymemo.lines.Strings[index]) = 1 THEN
   BEGIN
    allrefs := LocMymemo.lines.Strings[index];
    index := index+1;
    WHILE (index < LocMymemo.Lines.count-1)
    AND (POS('<',LocMymemo.lines.Strings[index])=1) DO
    BEGIN
     allrefs := allrefs + LocMymemo.lines.Strings[index];
     index := index+1;
    END
  END
  index := index+1;
 END;
  result:=allrefs;
END;

FUNCTION GetHeaderInfo(HeaderTag : string; var LocMymemo : tMemo): string;
BEGIN
 Result := RefsExtract(HeaderTag, LocMymemo);
 delete(Result, 1, length(HeaderTag));
END;

FUNCTION GetRefs(var LocMymemo : tMemo): string;
BEGIN
 result := GetHeaderInfo('References: ', LocMymemo);
END;
   
FUNCTION GetParent(var LocRefs: string): string;
var
 tag: string;
 index: integer;
 posiz, lung : integer;
BEGIN
 tag := '<';
 index := length(LocRefs)-1;
 result := '';
 posiz := 0;
 while (index > 0) and (posiz = 0) do
 begin
  if Pos(tag, LocRefs[index])=0 then
    index:=index-1
  else
    posiz := index;
    lung:=length(LocRefs)-posiz+1;
    result := copy(LocRefs, posiz, lung);
  end
END;

FUNCTION AreHeadersHid(var LocMymemo : tMemo): boolean;
var
 index: integer;
 temp: boolean;
BEGIN
 temp := true;
 IF LocMyMemo.Lines.count > 10 THEN
 BEGIN
  index := 0;
  WHILE (Index < LocMyMemo.Lines.count -1) and temp DO
  BEGIN
   index := index+1;
   temp := Pos('Newsgroups: ', LocMyMemo.Lines.strings[index]) = 0;
  END;
 END;
result := temp;
END;       

Begin
   myForm := tForm.Create(nil);
   myForm.width:=800;
   myForm.Height:=600;
   myMemo := tMemo.Create(myForm);
   myMemo.Parent := myForm;
   myMemo.Width := myForm.width;
   myMemo.Height := myForm.Height;
   try
   GetMessBody(myMemo);
   if AreHeadersHid(myMemo) then
      ADo('ShowHeaders');
   GetMessBody(myMemo);
   Refs := GetRefs(myMemo);
   myMemo.Clear;
   myMemo.Lines.Add(Refs);
   ParentID := GetParent(Refs);
   ClearClipboard;
   myMemo.Clear;
   myMemo.Lines.Add(ParentID);
   myMemo.SelectAll;
   myMemo.CopyToClipboard;
   if AreHeadersHid(myMemo) then
     ADo('ShowHeaders');
   finally
   myform.free;
   Ado('FindMessageID');
   end;
End.
-- 
Maria Luisa C - 20/12/2003 18.40.33, here.
http://fido.altervista.org/
Re: Default posting server for Dialog
#139628
Author: Jeff Relf
Date: Sat, 20 Dec 2003 18:02
12 lines
2010 bytes
Hello MLC ,  You wrote ,
" Done !  Now they work both .
    This is the new version  ( beta 0.2 ?  LOL ! ) "

Thanks again .

But it didn't work on my first try ,
  possibly because all my messages were marked as read ,
  or maybe because I'm using the  unread / unthreaded  view .

No big deal ,  I just went to another group to test it ...
  It works great !
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