🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
8 messages
8 total messages Started by Sqwertz Wed, 19 Aug 2015 23:03
[Dialog] Adding Plonk Filter VIA Script
#259427
Author: Sqwertz
Date: Wed, 19 Aug 2015 23:03
11 lines
1382 bytes
How do I add a GLOBAL plonk filter VIA a script?

ado('AddPlonkFiler') adds a plonk by name filter for the current email
for the current newsgroup.  I would like to add it to the global
section of the filter rules: [*]

I'm trying to make a script/button to add the current article's author
to the global filter.  My default action for adding a plonk rule is
!delete, if that matters.

-sw
Re: [Dialog] Adding Plonk Filter VIA Script
#259432
Author: Oliver Cromm
Date: Fri, 21 Aug 2015 17:52
23 lines
2221 bytes
* Sqwertz:

> How do I add a GLOBAL plonk filter VIA a script?
> 
> ado('AddPlonkFiler') adds a plonk by name filter for the current email
> for the current newsgroup.  I would like to add it to the global
> section of the filter rules: [*]
> 
> I'm trying to make a script/button to add the current article's author
> to the global filter.  My default action for adding a plonk rule is
> !delete, if that matters.

If you hold Ctrl while selecting the menu option, the plonk rule
goes to the global section (likewise for the other rules). Not
sure about the name of the corresponding script function, none is
listed at
<http://bertel.lundhansen.dk/?page=dialog/functionlist&m=M#Message>.

-- 
The most likely way for the world to be destroyed, most experts
agree, is by accident. That's where we come in; we're computer
professionals. We cause accidents.
  Nathaniel Borenstein
Re: [Dialog] Adding Plonk Filter VIA Script
#259434
Author: Sqwertz
Date: Sat, 22 Aug 2015 01:39
39 lines
2595 bytes
On Fri, 21 Aug 2015 13:52:02 -0400, Oliver Cromm wrote:

> * Sqwertz:
> 
>> How do I add a GLOBAL plonk filter VIA a script?
>> 
>> ado('AddPlonkFiler') adds a plonk by name filter for the current email
>> for the current newsgroup.  I would like to add it to the global
>> section of the filter rules: [*]
>> 
>> I'm trying to make a script/button to add the current article's author
>> to the global filter.  My default action for adding a plonk rule is
>> !delete, if that matters.
> 
> If you hold Ctrl while selecting the menu option, the plonk rule
> goes to the global section (likewise for the other rules). 

Yeah, I'm looking for a way to do it programmatically. 

> Not
> sure about the name of the corresponding script function, none is
> listed at
> <http://bertel.lundhansen.dk/?page=dialog/functionlist&m=M#Message>.

That only looks like a partial list of maybe just the menu commands 
(or maybe a previous version of Dialog?).  You can get a current full
list of functions by using Writeln(GetActionList);
Which lists the two plonk routines:

****
Caption: Add PLONK rule... Category: Message Name: AddPlonkFilter
Caption: Add subject PLONK rule... Category: Message Name: AddSubjectPlonkFilter
****

But I can't tell if I can pass any parameters to these or what they are.
And I don't think I can postkey() just a [CTRL] keypress before calling 
the procedure (I can't even find a reference for postkey())

-sw
Re: [Dialog] Adding Plonk Filter VIA Script
#259435
Author: Bernd Rose
Date: Sat, 22 Aug 2015 09:40
72 lines
4295 bytes
On Fr, 21 Aug 2015 20:39:50 -0500, Sqwertz wrote:

> On Fri, 21 Aug 2015 13:52:02 -0400, Oliver Cromm wrote:
> 
>> * Sqwertz:
>> 
>>> How do I add a GLOBAL plonk filter VIA a script?
[...]
>> If you hold Ctrl while selecting the menu option, the plonk rule
>> goes to the global section (likewise for the other rules). 
> 
> Yeah, I'm looking for a way to do it programmatically. 

If you adjust a keyboard combination to Message->AddPlonkRule, that
contains <Ctrl> (e.g.: Ctrl+k), than the Plonk rule goes straight to
the global section. You'd still need to overwrite the plonk-rule with
your preferred action !delete, though. (And close the Scoring dialog
by <Alt+o> or mouse click, afterwards.)

>> <http://bertel.lundhansen.dk/?page=dialog/functionlist&m=M#Message>.
> 
> That only looks like a partial list of maybe just the menu commands 
> (or maybe a previous version of Dialog?).  You can get a current full
> list of functions by using Writeln(GetActionList);
> Which lists the two plonk routines:
> 
> ****
> Caption: Add PLONK rule... Category: Message Name: AddPlonkFilter
> Caption: Add subject PLONK rule... Category: Message Name: AddSubjectPlonkFilter
> ****

Oliver sure is aware of the method of creating the list by script.
I guess, he just pointed you to Bertels website, because you'll find
all functions thematically sorted over there. Both Plonk functions 
you mentioned /are/ listed on that site, btw.

> But I can't tell if I can pass any parameters to these 

That's not possible.

> And I don't think I can postkey() just a [CTRL] keypress before calling 
> the procedure 

That's not the way, the Postkey() function works. You /could/ create 
a Postkey() sequence, though, which simulates key presses that mimic
clicking on the respecting menu entry for AddPlonkRule. (Or you could
call Postkey() for the <Ctrl+...> shortcut mentioned above.) Either of
these ways still won't work, though. That's because Dialog evaluates
the special functionality of alternate menu invocations (i.e. with
pressed Shift/Ctrl keys) independently from any evaluation of script
code.

Instead of ADo() you could use ADoLater(). This way, the still pressed
Ctrl key (provided you still hold it down while the script execution
finishes) will be evaluated. You don't win anything compared to the
assigning of a shortcut, though: Any code you write after ADoLater(),
e.g. Postkey() for "!delete" and <Alt+o>, will /not/ be evaluated
after ADoLater....

> I can't even find a reference for postkey()

Search for Postkey inside the Dialog help file. All parameters except
the first one are Boolean (= True/False). For a reference of the first
parameter check Microsofts information for virtual key code numbers:

  http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731

You need to convert any hexadecimal number listed to decimal before
using them with Postkey(), e.g. 0x28 (Arrow_Down) becomes decimal 40.

HTH.
Bernd
Re: [Dialog] Adding Plonk Filter VIA Script
#259439
Author: Sqwertz
Date: Sat, 22 Aug 2015 15:52
101 lines
5217 bytes
On Sat, 22 Aug 2015 11:40:21 +0200, Bernd Rose wrote:

> On Fr, 21 Aug 2015 20:39:50 -0500, Sqwertz wrote:
> 
>> On Fri, 21 Aug 2015 13:52:02 -0400, Oliver Cromm wrote:
>> 
>>> * Sqwertz:
>>> 
>>>> How do I add a GLOBAL plonk filter VIA a script?
> [...]
>>> If you hold Ctrl while selecting the menu option, the plonk rule
>>> goes to the global section (likewise for the other rules). 
>> 
>> Yeah, I'm looking for a way to do it programmatically. 
> 
> If you adjust a keyboard combination to Message->AddPlonkRule, that
> contains <Ctrl> (e.g.: Ctrl+k), than the Plonk rule goes straight to
> the global section. You'd still need to overwrite the plonk-rule with
> your preferred action !delete, though. (And close the Scoring dialog
> by <Alt+o> or mouse click, afterwards.)
> 
>>> <http://bertel.lundhansen.dk/?page=dialog/functionlist&m=M#Message>.
>> 
>> That only looks like a partial list of maybe just the menu commands 
>> (or maybe a previous version of Dialog?).  You can get a current full
>> list of functions by using Writeln(GetActionList);
>> Which lists the two plonk routines:
>> 
>> ****
>> Caption: Add PLONK rule... Category: Message Name: AddPlonkFilter
>> Caption: Add subject PLONK rule... Category: Message Name: AddSubjectPlonkFilter
>> ****
> 
> Oliver sure is aware of the method of creating the list by script.
> I guess, he just pointed you to Bertels website, because you'll find
> all functions thematically sorted over there. Both Plonk functions 
> you mentioned /are/ listed on that site, btw.
> 
>> But I can't tell if I can pass any parameters to these 
> 
> That's not possible.
> 
>> And I don't think I can postkey() just a [CTRL] keypress before calling 
>> the procedure 
> 
> That's not the way, the Postkey() function works. You /could/ create 
> a Postkey() sequence, though, which simulates key presses that mimic
> clicking on the respecting menu entry for AddPlonkRule. (Or you could
> call Postkey() for the <Ctrl+...> shortcut mentioned above.) Either of
> these ways still won't work, though. That's because Dialog evaluates
> the special functionality of alternate menu invocations (i.e. with
> pressed Shift/Ctrl keys) independently from any evaluation of script
> code.
> 
> Instead of ADo() you could use ADoLater(). This way, the still pressed
> Ctrl key (provided you still hold it down while the script execution
> finishes) will be evaluated. You don't win anything compared to the
> assigning of a shortcut, though: Any code you write after ADoLater(),
> e.g. Postkey() for "!delete" and <Alt+o>, will /not/ be evaluated
> after ADoLater....
> 
>> I can't even find a reference for postkey()
> 
> Search for Postkey inside the Dialog help file. All parameters except
> the first one are Boolean (= True/False). For a reference of the first
> parameter check Microsofts information for virtual key code numbers:
> 
>   http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731
> 
> You need to convert any hexadecimal number listed to decimal before
> using them with Postkey(), e.g. 0x28 (Arrow_Down) becomes decimal 40.

OK, so I think I understand most of this.  Basically, I'm never going 
to get the functionality I want with a button without holding down the 
[CRTL].

But the keyboard shortcut method works because I'm already holding 
down [CTRL], which I guess will have to do instead of a mouse press
(a mouse click is preferred as that's where my hands will be when I 
need to perform this action)

The default plonk rule can be changed with:

[Scoring]
DefPlonk=!delete           # Action for 'Add Plonk Rule'

So no worries there.  But I'm still at a loss for postkey().  Why 
doesn't...

Program PlonkButton;
Begin  
    PostKey(79, false, true, false, false, false, false, false, false);  
    ado('AddPlonkFilter');
End.

.... close the Plonk dialog window?  That's the example usage I see 
in other sample scripts to close message dialogs.

Thanks for you help, as always!

-sw
Re: [Dialog] Adding Plonk Filter VIA Script
#259437
Author: Sqwertz
Date: Sat, 22 Aug 2015 16:02
10 lines
1535 bytes
On Sat, 22 Aug 2015 11:40:21 +0200, Bernd Rose wrote:

> Oliver sure is aware of the method of creating the list by script.
> I guess, he just pointed you to Bertels website, because you'll find
> all functions thematically sorted over there. Both Plonk functions 
> you mentioned /are/ listed on that site, btw.

And yes - sorry I didn't see those on there earlier.

-sw
Re: [Dialog] Adding Plonk Filter VIA Script
#259438
Author: Bernd Rose
Date: Sat, 22 Aug 2015 17:27
55 lines
3601 bytes
On Sa, 22 Aug 2015 10:52:32 -0500, Sqwertz wrote:

> OK, so I think I understand most of this.  Basically, I'm never going 
> to get the functionality I want with a button without holding down the 
> [CRTL].

I didn't know you wanted a script, because you want to assign it to 
a button. You probably know, that you can drag Message->AddPlonkRule 
into a toolbar. If you click on that button while holding down the 
Ctrl key, the Plonk rule will be incorporated in the General Section 
(aka [*]) of the plonk list.
 
> But the keyboard shortcut method works because I'm already holding 
> down [CTRL], which I guess will have to do instead of a mouse press
> (a mouse click is preferred as that's where my hands will be when I 
> need to perform this action)

Since you probably use the mouse with only one hand, the above method
(Ctrl+Left_Mouse) will probably suffice?
 
> The default plonk rule can be changed with:
> 
> [Scoring]
> DefPlonk=!delete           # Action for 'Add Plonk Rule'

Ah. I forgot about that setting!
 
> So no worries there.  But I'm still at a loss for postkey().  Why 
> doesn't...
> 
> Program PlonkButton;
> Begin  
>     PostKey(79, false, true, false, false, false, false, false, false);  
>     ado('AddPlonkFilter');
> End.
> 
> ... close the Plonk dialog window?  That's the example usage I see 
> in other sample scripts to close message dialogs.

The above doesn't work, because Dialog does not pre-store keycodes
for execution inside a following ADo() function call. If you alter
the sequence of both lines, the keystroke still would not be
recognized. The same goes for setting up a timer to insert the key
combination from there. This, again, will only be evaluated, after
the Scoring/Actions dialog has been closed.

What you /could/ do is calling the above mentioned shortcut key to 
AddPlonkRule via Postkey() instead of calling ADo('AddPlonkFilter').
If you follow this up by Postkey() for <Alt+o> the Scoring/Actions 
dialog /will/ be closed. But this way (even if the shortcut contains 
Ctrl), the Plonk rule will end up in the section of the current 
newsgroup. (Ctrl is omitted from evaluation in this situation.)

HTH.
Bernd
Re: [Dialog] Adding Plonk Filter VIA Script
#259450
Author: Sqwertz
Date: Tue, 25 Aug 2015 17:12
60 lines
3859 bytes
On Sat, 22 Aug 2015 19:27:52 +0200, Bernd Rose wrote:

> On Sa, 22 Aug 2015 10:52:32 -0500, Sqwertz wrote:
> 
>> OK, so I think I understand most of this.  Basically, I'm never going 
>> to get the functionality I want with a button without holding down the 
>> [CRTL].
> 
> I didn't know you wanted a script, because you want to assign it to 
> a button. You probably know, that you can drag Message->AddPlonkRule 
> into a toolbar. If you click on that button while holding down the 
> Ctrl key, the Plonk rule will be incorporated in the General Section 
> (aka [*]) of the plonk list.

My reasons for originally wanting the script is because I thought I
could force a script to put it into the global section [*] of the
scorefile.  And I wanted it to automatically close the window.

>> So no worries there.  But I'm still at a loss for postkey().  Why 
>> doesn't...
>> 
>> Program PlonkButton;
>> Begin  
>>     PostKey(79, false, true, false, false, false, false, false, false);  
>>     ado('AddPlonkFilter');
>> End.
>> 
>> ... close the Plonk dialog window?  That's the example usage I see 
>> in other sample scripts to close message dialogs.
> 
> The above doesn't work, because Dialog does not pre-store keycodes
> for execution inside a following ADo() function call. If you alter
> the sequence of both lines, the keystroke still would not be
> recognized. The same goes for setting up a timer to insert the key
> combination from there. This, again, will only be evaluated, after
> the Scoring/Actions dialog has been closed.

I see other scripts that use this exact method to close dialog
windows.  This script shows a bunch of stuff being stuffed into the
keyboard before calling ado('addplonkfilter').  Of course I haven't
actually *tried* that script... 

http://dialog.datalist.org/scripts/ExpireRelative.html

> What you /could/ do is calling the above mentioned shortcut key to 
> AddPlonkRule via Postkey() instead of calling ADo('AddPlonkFilter').
> If you follow this up by Postkey() for <Alt+o> the Scoring/Actions 
> dialog /will/ be closed. But this way (even if the shortcut contains 
> Ctrl), the Plonk rule will end up in the section of the current 
> newsgroup. (Ctrl is omitted from evaluation in this situation.)

I'm not sure what you mean by calling AddPlonkRule VIA postkey().  But
it not being added to the global scorefile section would be a
show-stopper for me anyway.

At this point this problem and solution is more of a curiosity than a
necessity for me.  I was just trying to save a few keystrokes a few
times a week :-)

-sw
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