Article View: news.software.readers
Article #259439Re: [Dialog] Adding Plonk Filter VIA Script
From: Sqwertz
Date: Sat, 22 Aug 2015 15:52
Date: Sat, 22 Aug 2015 15:52
101 lines
5217 bytes
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
Technical Details
Message-ID:
<1jhx4h5xcf8b1$.dlg@sqwertz.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mailReferences:
<9n5luk74js3m.dlg@sqwertz.com> <5gxdor48w114.dlg@mid.crommatograph.info> <zhp6ot4xonlc.dlg@sqwertz.com> <dcemf34tmo1v$.dlg@b.rose.tmpbox.news.arcor.de>Show Full Headers
Complete Article Headers
Message-ID: <1jhx4h5xcf8b1$.dlg@sqwertz.com> Subject: Re: [Dialog] Adding Plonk Filter VIA Script Date: Sat, 22 Aug 2015 10:52:32 -0500 From: Sqwertz <swertz@cluemail.compost> References: <9n5luk74js3m.dlg@sqwertz.com> <5gxdor48w114.dlg@mid.crommatograph.info> <zhp6ot4xonlc.dlg@sqwertz.com> <dcemf34tmo1v$.dlg@b.rose.tmpbox.news.arcor.de> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail Newsgroups: news.software.readers Organization: Me, Myself, and Inc. Lines: 101 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Injection-Info: mx02.eternal-september.org; posting-host="25267948b74595c2af949a00d0309401"; logging-data="14747"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18OstnmFC37vLfQSjK+I1rc" User-Agent: Forte Agent 2.0/32.652 Cancel-Lock: sha1:6zuBcwN58etohe7p3FKzGBZOYvs= X-no-archive: yes X-Received-Body-CRC: 371670536 X-Received-Bytes: 5253