Article View: news.software.readers
Article #218586Re: 40tude Dialog: Sorting on watched flag. Need help with script.
From: VanguardLH
Date: Sat, 05 Apr 2008 17:29
Date: Sat, 05 Apr 2008 17:29
137 lines
7183 bytes
7183 bytes
"Rom" <-@-.invalid> wrote in message
news:6aod2sok6yhy.1i6rae0xm67m$.dlg@40tude.net...
> On Fri, 4 Apr 2008 19:44:54 -0500, VanguardLH wrote:
>
>> The sort parameters for the message list do not include flags, like
>> the
>> watch flag. So I figured to up the score of a message when the
>> watched
>> flag was set on it.
>>
>> No, I do not want to use a "!watched <criteria> <parm>" line in the
>> scroing rules. That marks a message as watched if the criteria is
>> met.
>> That is the wrong way around. I don't want to watch all messages,
>> for
>> example, that I post. Instead I want to decide which threads to
>> watch
>> (I have Dialog configured to not just flag on a subthread but
>> instead on
>> the whole thread). I want to set a score for the message based on
>> whether or not *I* set watch flag. Since I can sort on the
>> message's
>> score value, I want to assign a high score to any thread where I
>> *choose* to watch it. If I clear the watch flag, the score should
>> be
>> low or zero to get it out of the top of the sorted list (i.e., it
>> isn't
>> being watched anymore).
>
> I looked through the old messages I still have for this group and
> found a script by MLC that will do what you want. All I've done is
> added Watch to it and tested it with a keyboard shortcut, but you
> can
> also add a custom/own button in Dialog.
>
> Double-click <dialog.chm::/scripting.htm>, which should open the
> Scripting page in Dialog's Help, then read the second paragraph.
> The icons added to ...\Scripts\Icons should be 20 x 20 bitmaps.
>
> How this works is use a keyboard shortcut or button, enter the
> score,
> say, 9999, and it will add the Watch flag too. Use the keyboard
> shortcut or button again, enter 0 (zero) to unwatch and reset the
> score.
>
> It's from this message (I added the Watch to it):
> From: MLC
> Newsgroups: news.software.readers
> Subject: Re: [Dialog] Adjust score for subject up?
> Date: Sat, 10 Jan 2004 23:04:06 +0100
> Message-ID: <y96aaf2e3n7t$.dlg@ID-187316.user.uni-berlin.de>
>
> Program PutScore;
> uses
> Forms,
> StdCtrls;
>
> var
> s:string;
> myForm : TForm;
> myMemo : TMemo;
>
> Begin
> s:='';
> myForm:=TForm.Create(nil);
> myForm.Width:=80;
> myForm.Height:=40;
> myMemo:=TMemo.Create(myForm);
> myMemo.Parent:=myForm;
> myMemo.Width:=50;
> s:=Readln('How many?');
> if s='' then exit;
> myMemo.Text:=s;
> myMemo.SelectAll;
> myMemo.CopyToClipboard;
>
> PostKey(77, false, true, false, false, false, false, false, false);
> //the above is 80 for the Italian version;
>
> PostKey(9, false, false, false, false, false, false, false, false);
> PostKey(86, false, false, true, false, false, false, false, false);
> PostKey(13, false, false, false, false, false, false, false, false);
> ADo('MessageProperties');
> myForm.free;
> ADo('Watch');
> End.
>
> Save and compile with Ctr-F9 (not with the green triangles), then
> assign a
> hotkey.
It looks like that script opens a form where the user can enter a
value (How many?) and then pastes it to a buffer (clipboard). Rather
than enter the value into the input field using PostKey for each
character ('9', '9', '9', '9') as I did, it uses Ctrl-V (the 86
keycode with 'true' 4th parameter). It also then hits the Enter key
(13 keycode) instead of where I tried to use Alt+O (for the OK
button). What I really see different is that the keystrokes for
PostKey look to get buffered up. That is, PostKey is used *before*
the dialog window is opened with the ADo function.
In some scripts, I noticed the use of ADoLater() to open the dialog
window which is then followed by the PostKey functions to issue
keystrokes, as at
http://dialog.datalist.org/scripts/ScriptTrashBin.html. I could not
find documentation in Dialog's help about ADoLater. In other
examples, like at
http://dialog.datalist.org/scripts/ExpireRelative.html, and like your
code shown here, the ADo() is used *after* the PostKey commands. In
another example, at
http://dialog.datalist.org/scripts/ScriptPaterNoster.html, the ADo()
is used first and followed by the PostKey commands but it seems that
example merely changes focus rather than open a new dialog window.
So I see some examples that use the undocumented ADoLater() which is
followed by PostKey(). In some examples, I see PostKey() followed by
ADo(). In some examples, I see ADo() followed by PostKey() but the
ones that I looked at are changing focus (to a pane or object in the
GUI) rather than opening a new window. So I'm wondering if PostKey()
is buffering up the keystrokes until the next window that gets focus.
I use ADo() to open the window and then use PostKey() but those
keystrokes are not seen by the new window opened by ADo() but instead
by the main window when the new window gets closed. So other than
when ADo() is used to change focus and then use PostKey(), it seems to
get the keystrokes in a newly opened window that I must either:
- Use ADoLater() that will accept what PostKey() buffered up.
- Use PostKey() first to buffer up the keystrokes and then use ADo()
to open the window.
I'll see what happens if I do the 2nd scheme. I can't find any
documentation on ADoLater() to know how to use it. I don't want to
bother with a popup form where I have to enter the scoring value when
what I want done is to toggle the watch flag and score based on
whether the watched flag is on or off.
Technical Details
Message-ID:
<c8ydnV0pwK90K2ranZ2dnUVZ_v-hnZ2d@comcast.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.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mailReferences:
<ft6i1v$clo$1@registered.motzarella.org> <6aod2sok6yhy.1i6rae0xm67m$.dlg@40tude.net>Show Full Headers
Complete Article Headers
Message-ID: <c8ydnV0pwK90K2ranZ2dnUVZ_v-hnZ2d@comcast.com> Subject: Re: 40tude Dialog: Sorting on watched flag. Need help with script. Date: Sat, 5 Apr 2008 12:29:19 -0500 From: "VanguardLH" <V@nguard.LH> References: <ft6i1v$clo$1@registered.motzarella.org> <6aod2sok6yhy.1i6rae0xm67m$.dlg@40tude.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 05 Apr 2008 12:29:13 -0500 Newsgroups: news.software.readers MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Lines: 137 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 69.180.133.182 X-Trace: sv3-DH8EdqAVjOA5XtKsE8CrxSrA1MigC1jkNjkBtXQmCD0FFKFllwDRua+JxrV25MYaUYn64V28arU9WnN!5VQH1LUm5n/mzjJlrVweLabnC5/v/W9UOYeYE3x1FzswOalw2+tXc5TzsPvJd5OOzDs3rnaWPOSR!5V/ctOUynr1qFF3CB4qI/Dzj+bpvmUo= X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.38