🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
60 messages
60 total messages Page 2 of 2 Started by Jim S Sat, 17 Apr 2021 19:07
Page 2 of 2 • 60 total messages
Re: Newsreaders eh?
#265500
Author: Jim S
Date: Mon, 25 Apr 2022 13:51
80 lines
4260 bytes
On Sun, 18 Apr 2021 13:04:05 +0200, Bernd Rose wrote:

> On Sun, 18th Apr 2021 10:53:35 +0100, Jim S wrote:
> 
> [40tude Dialog: 2 Scripts to plonk without confirmation dialog] 
>> I understand the scripts, but not this :
>> First stuffing the keyboard buffer with Alt+o (to get the 
>> Scoring&Actions
>> window closed, later on) may seem counter-intuitive. But the scripts 
>> work only this way round.
> 
> This is just an explanation of the inner workings of the scripts. You
> can safely ignore this.
> 
> The following shows a complete walk-through for creating the scripts and
> assigning the shortcuts. The whole process can, IMHO, be finished in 
> less than 5 minutes.
> 
> 1) Open the Script editor: menu Settings -> Scripting -> Scripting...
> 2) Select the "Custom scripts" tab on the left side of the Script editor
> 3) Choose menu File -> New script...  and enter DoPlonk as name.
>    Now a new entry DoPlonk.ds is created in the list of "Custom scripts"
>    This entry is pre-selected.
> 4) In the script body window on the right side you'll see 3 lines of code.
> 5) Overwrite these 3 lines with:
> 
> Program DoPlonk;
> Begin
>   PostKey(79, false, true, false, false, false, false, false, false);
>   ADo('AddPlonkFilter');
> End.
> 
> 6) Save the script: menu File -> Save
> 7) Compile the script: menu Script -> Compile
> 
> 8) Choose menu File -> New script...  again and enter DoSubjPlonk as name.
> 9) Again overwrite the 3 standard lines of script code. This time with:
> 
> Program DoSubjPlonk;
> Begin
>   PostKey(79, false, true, false, false, false, false, false, false);
>   ADo('AddSubjectPlonkFilter');
> End.
> 
> 10) Save the script: menu File -> Save
> 11) Compile the script: menu Script -> Compile
> 
> 12) Close the Script editor window.
> 
> 13) Open the Shortcut editor: menu Settings -> Configure buttons/shortcuts
> 14) Choose "Scripts" (the last entry in the Categories list on the left side
> 15) Select DoPlonk from the Commands list on the right side
> 16) Click in the field beside the label "Shortcut*" 
> 17) Hit whatever keyboard shortcut you wish to assign to DoPlonk
> 18) Select DoSubjPlonk from the Commands list
> 19) Click again in the field beside the label "Shortcut*" 
> 20) Hit whatever keyboard shortcut you wish to assign to DoSubjPlonk
> 21) Close the Shortcut editor
> 
> When you try to assign a shortcut to DoPlonk or DoSubjPlonk, which is 
> already in use by another command, you can decide to either assign the
> shortcut, anyway. (Overwrite? -> YES.) This way, the former command will
> loose that shortcut and DoPlonk or DoSubjPlonk will be executed by this
> shortcut from now on. 
> 
> Or you can cancel the assignment of that shortcut. (Overwrite? -> NO.)
> This way, you'll be back in the field "Shortcut*" and can try to assign
> another one.
> 
> HTH.
> Bernd

Hi Bernd
I finally plucked up the courage to do these scripts (53 weeks after) 
Of course it works a treat, but I would quite like it to delete the header
at the same time.
Currently I have to read the article and them - 'show only unread'
Can I amend the scripts you sent or is that a whole new can of worms?
-- 
Jim S
Re: Newsreaders eh?
#265501
Author: Bernd Rose
Date: Mon, 25 Apr 2022 16:50
21 lines
1987 bytes
On Mon, 25th Apr 2022 14:51:11 +0100, Jim S wrote:

[40tude Dialog: 2 Scripts to plonk without confirmation dialog] 
> I finally plucked up the courage to do these scripts (53 weeks after) 
> Of course it works a treat, but I would quite like it to delete the header
> at the same time.
> Currently I have to read the article and them - 'show only unread'
> Can I amend the scripts you sent or is that a whole new can of worms?

IMHO, we already talked about this in this very thread. Please take a 
look at my altered versions of the scripts from 2021-04-19 (18:42):

Message-ID: <1fevaouhkj7bx.dlg@b.rose.tmpbox.news.arcor.de>
https://groups.google.com/g/news.software.readers/c/gtvdBh2OEVU/m/5u8Lbv-NAwAJ

If you set your default view to hide ignored messages, plonked messages
should disappear immediately after applying the newer versions of the
plonk scripts.

HTH.
Bernd
Re: Newsreaders eh?
#265502
Author: Jim S
Date: Mon, 25 Apr 2022 18:24
27 lines
2169 bytes
On Mon, 25 Apr 2022 18:50:29 +0200, Bernd Rose wrote:

> On Mon, 25th Apr 2022 14:51:11 +0100, Jim S wrote:
> 
> [40tude Dialog: 2 Scripts to plonk without confirmation dialog] 
>> I finally plucked up the courage to do these scripts (53 weeks after) 
>> Of course it works a treat, but I would quite like it to delete the header
>> at the same time.
>> Currently I have to read the article and them - 'show only unread'
>> Can I amend the scripts you sent or is that a whole new can of worms?
> 
> IMHO, we already talked about this in this very thread. Please take a 
> look at my altered versions of the scripts from 2021-04-19 (18:42):
> 
> Message-ID: <1fevaouhkj7bx.dlg@b.rose.tmpbox.news.arcor.de>
> https://groups.google.com/g/news.software.readers/c/gtvdBh2OEVU/m/5u8Lbv-NAwAJ
> 
> If you set your default view to hide ignored messages, plonked messages
> should disappear immediately after applying the newer versions of the
> plonk scripts.
> 
> HTH.
> Bernd

Ah! My default view is to hide 'read' messages.
-- 
Jim S
Re: Newsreaders eh?
#265503
Author: Bernd Rose
Date: Mon, 25 Apr 2022 20:02
43 lines
2487 bytes
On Mon, 25th Apr 2022 19:24:54 +0100, Jim S wrote:

> Ah! My default view is to hide 'read' messages.

Hiding on status 'read' hampers access to articles already read, but still
containing worthwhile information. Therefore, status 'ignore' usually is
preferred as hiding pointer. But depending on your pre-defined default
plonk-rule either or even both status variants can work. The default
plonk rule is set up in the [Scoring] section of the Dialog settings.ini
(located in the main Dialog directory), for example:

[Scoring]
DefPlonk=!ignore,markread

If you wish to alter the setting, make sure that Dialog is closed before
you edit settings.ini.

For /instant/ hiding you nevertheless need to use the newer script variants 
from the message I linked to. Below you see them with /another/ alteration.
I added 'MarkRead' in both scripts. So either filter should work now.


Program DoPlonk;
Begin
  PostKey(79, false, true, false, false, false, false, false, false);
  ADo('AddPlonkFilter');
  ADo('Ignore');
  ADo('MarkRead');
  ADo('RefreshView');
End.

Program DoSubjPlonk;
Begin
  PostKey(79, false, true, false, false, false, false, false, false);
  ADo('AddSubjectPlonkFilter');
  ADo('Ignore');
  ADo('MarkRead');
  ADo('RefreshView');
End.


HTH.
Bernd
Re: Newsreaders eh?
#265504
Author: Jim S
Date: Mon, 25 Apr 2022 23:12
14 lines
1502 bytes
On Mon, 25 Apr 2022 22:02:08 +0200, Bernd Rose wrote:

> Program DoPlonk;
> Begin
>   PostKey(79, false, true, false, false, false, false, false, false);
>   ADo('AddPlonkFilter');
>   ADo('Ignore');
>   ADo('MarkRead');
>   ADo('RefreshView');
> End.

Thanks again guru
-- 
Jim S
Re: Newsreaders eh?
#265505
Author: Jim S
Date: Tue, 26 Apr 2022 08:23
50 lines
2741 bytes
On Mon, 25 Apr 2022 22:02:08 +0200, Bernd Rose wrote:

> On Mon, 25th Apr 2022 19:24:54 +0100, Jim S wrote:
> 
>> Ah! My default view is to hide 'read' messages.
> 
> Hiding on status 'read' hampers access to articles already read, but still
> containing worthwhile information. Therefore, status 'ignore' usually is
> preferred as hiding pointer. But depending on your pre-defined default
> plonk-rule either or even both status variants can work. The default
> plonk rule is set up in the [Scoring] section of the Dialog settings.ini
> (located in the main Dialog directory), for example:
> 
> [Scoring]
> DefPlonk=!ignore,markread
> 
> If you wish to alter the setting, make sure that Dialog is closed before
> you edit settings.ini.
> 
> For /instant/ hiding you nevertheless need to use the newer script variants 
> from the message I linked to. Below you see them with /another/ alteration.
> I added 'MarkRead' in both scripts. So either filter should work now.
> 
> 
> Program DoPlonk;
> Begin
>   PostKey(79, false, true, false, false, false, false, false, false);
>   ADo('AddPlonkFilter');
>   ADo('Ignore');
>   ADo('MarkRead');
>   ADo('RefreshView');
> End.
> 
> Program DoSubjPlonk;
> Begin
>   PostKey(79, false, true, false, false, false, false, false, false);
>   ADo('AddSubjectPlonkFilter');
>   ADo('Ignore');
>   ADo('MarkRead');
>   ADo('RefreshView');
> End.
> 
> 
> HTH.
> Bernd

Follow-up
Apart from their names aren't these two scripts identical?
-- 
Jim S
Re: Newsreaders eh?
#265509
Author: Bernd Rose
Date: Tue, 26 Apr 2022 16:27
36 lines
2275 bytes
On Tue, 26th Apr 2022 09:23:21 +0100, Jim S wrote:

>> Program DoPlonk;
>> Begin
>>   PostKey(79, false, true, false, false, false, false, false, false);
>>   ADo('AddPlonkFilter');
          ^^^^^^^^^^^^^^
>>   ADo('Ignore');
>>   ADo('MarkRead');
>>   ADo('RefreshView');
>> End.
>> 
>> Program DoSubjPlonk;
>> Begin
>>   PostKey(79, false, true, false, false, false, false, false, false);
>>   ADo('AddSubjectPlonkFilter');
          ^^^^^^^^^^^^^^^^^^^^^
>>   ADo('Ignore');
>>   ADo('MarkRead');
>>   ADo('RefreshView');
>> End.
>> 
>> HTH.
>> Bernd
> 
> Follow-up
> Apart from their names aren't these two scripts identical?

Not entirely. ;-)  I marked the relevant differences above. 

Originally, you wanted to be able to alternatively plonk on name 
(= first script) as well as on subject (= second script). Both 
approaches require the call of different Dialog-internal functions.
The later "housekeeping" in these scripts is identical, though...

Bernd
Re: Newsreaders eh?
#265520
Author: Jim S
Date: Tue, 26 Apr 2022 17:29
47 lines
2767 bytes
On Tue, 26 Apr 2022 18:27:06 +0200, Bernd Rose wrote:

> On Tue, 26th Apr 2022 09:23:21 +0100, Jim S wrote:
> 
>>> Program DoPlonk;
>>> Begin
>>>   PostKey(79, false, true, false, false, false, false, false, false);
>>>   ADo('AddPlonkFilter');
>           ^^^^^^^^^^^^^^
>>>   ADo('Ignore');
>>>   ADo('MarkRead');
>>>   ADo('RefreshView');
>>> End.
>>> 
>>> Program DoSubjPlonk;
>>> Begin
>>>   PostKey(79, false, true, false, false, false, false, false, false);
>>>   ADo('AddSubjectPlonkFilter');
>           ^^^^^^^^^^^^^^^^^^^^^
>>>   ADo('Ignore');
>>>   ADo('MarkRead');
>>>   ADo('RefreshView');
>>> End.
>>> 
>>> HTH.
>>> Bernd
>> 
>> Follow-up
>> Apart from their names aren't these two scripts identical?
> 
> Not entirely. ;-)  I marked the relevant differences above. 
> 
> Originally, you wanted to be able to alternatively plonk on name 
> (= first script) as well as on subject (= second script). Both 
> approaches require the call of different Dialog-internal functions.
> The later "housekeeping" in these scripts is identical, though...
> 
> Bernd

Yes. I was initially plonking by subject and seperately by name using the
built in Plonk Rule and Subject-Plonk Rule repectively.
I got fed up with being asked every time and you came to my rescue.
I vaguelly remember plonking by name and address, but cannot remember
whether I still have that.
No matter it really is all flim-flam anway :-)
-- 
Jim S
Re: Newsreaders eh?
#265521
Author: Jim S
Date: Tue, 26 Apr 2022 17:31
161 lines
4742 bytes
On Tue, 26 Apr 2022 18:27:06 +0200, Bernd Rose wrote:

> On Tue, 26th Apr 2022 09:23:21 +0100, Jim S wrote:
> 
>>> Program DoPlonk;
>>> Begin
>>>   PostKey(79, false, true, false, false, false, false, false, false);
>>>   ADo('AddPlonkFilter');
>           ^^^^^^^^^^^^^^
>>>   ADo('Ignore');
>>>   ADo('MarkRead');
>>>   ADo('RefreshView');
>>> End.
>>> 
>>> Program DoSubjPlonk;
>>> Begin
>>>   PostKey(79, false, true, false, false, false, false, false, false);
>>>   ADo('AddSubjectPlonkFilter');
>           ^^^^^^^^^^^^^^^^^^^^^
>>>   ADo('Ignore');
>>>   ADo('MarkRead');
>>>   ADo('RefreshView');
>>> End.
>>> 
>>> HTH.
>>> Bernd
>> 
>> Follow-up
>> Apart from their names aren't these two scripts identical?
> 
> Not entirely. ;-)  I marked the relevant differences above. 
> 
> Originally, you wanted to be able to alternatively plonk on name 
> (= first script) as well as on subject (= second script). Both 
> approaches require the call of different Dialog-internal functions.
> The later "housekeeping" in these scripts is identical, though...
> 
> Bernd

PS. Just checked and found this:
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.
-- 
Jim S
Page 2 of 2 • 60 total messages
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