Article View: news.software.readers
Article #259435Re: [Dialog] Adding Plonk Filter VIA Script
From: Bernd Rose
Date: Sat, 22 Aug 2015 09:40
Date: Sat, 22 Aug 2015 09:40
72 lines
4295 bytes
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
Technical Details
Message-ID:
<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-mailReferences:
<9n5luk74js3m.dlg@sqwertz.com> <5gxdor48w114.dlg@mid.crommatograph.info> <zhp6ot4xonlc.dlg@sqwertz.com>Show Full Headers
Complete Article Headers
Message-ID: <dcemf34tmo1v$.dlg@b.rose.tmpbox.news.arcor.de> Subject: Re: [Dialog] Adding Plonk Filter VIA Script Date: Sat, 22 Aug 2015 11:40:21 +0200 From: Bernd Rose <b.rose.tmpbox@arcor.de> References: <9n5luk74js3m.dlg@sqwertz.com> <5gxdor48w114.dlg@mid.crommatograph.info> <zhp6ot4xonlc.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-mail Newsgroups: news.software.readers Organization: albasani.net Lines: 72 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net z0grvTGBzTICiGVeZVgNbqTi5+QRtfhIFAAFDaZNBdUZs3bmVpkyTeBQv2F/9BwxyXpBrfE18tBAqNa9CgK+rQ== NNTP-Posting-Date: Sat, 22 Aug 2015 09:40:23 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="ufUDdSZnMncQgHkJqHomfrJ+WOwwRk/YVmtXqpnDLYqmU2xObtYORNeqjapeHIC7E6OODatOGYUCx1bCL3CoOny3yR5BAOmVxLweagOKTDGjqPSCtpQHm8hHoMnzfazg"; mail-complaints-to="abuse@albasani.net" User-Agent: 40tude_Dialog/2.0.15.41 (bd38f604.72.487) Cancel-Lock: sha1:gHULxUhuyGeCmWL7EbPO5CZlYBM= X-Received-Bytes: 4127 X-Received-Body-CRC: 984756743