Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"I don't think so," said Ren'e Descartes. Just then, he vanished.


computers / news.software.readers / Re: [dialog] Can I set dialog to edit in Notepad++

SubjectAuthor
* [dialog] Can I set dialog to edit in Notepad++bill
+* Re: [dialog] Can I set dialog to edit in Notepad++Bernd Rose
|`* Re: [dialog] Can I set dialog to edit in Notepad++bill
| `- Re: [dialog] Can I set dialog to edit in Notepad++Bernd Rose
`* Re: [dialog] Can I set dialog to edit in Notepad++VanguardLH
 `* Re: [dialog] Can I set dialog to edit in Notepad++bill
  +* Re: [dialog] Can I set dialog to edit in Notepad++Kerr-Mudd, John
  |`* Re: [dialog] Can I set dialog to edit in Notepad++bill
  | +- Re: [dialog] Can I set dialog to edit in Notepad++Bernd Rose
  | +* Re: [dialog] Can I set dialog to edit in Notepad++VanguardLH
  | |`* Re: [dialog] Can I set dialog to edit in Notepad++bill
  | | `* Re: [dialog] Can I set dialog to edit in Notepad++Bernd Rose
  | |  `* Re: [dialog] Can I set dialog to edit in Notepad++bill
  | |   `* Re: [dialog] Can I set dialog to edit in Notepad++Bernd Rose
  | |    `* Re: [dialog] Can I set dialog to edit in Notepad++VanguardLH
  | |     +* Re: [dialog] Can I set dialog to edit in Notepad++bill
  | |     |`* Re: [dialog] Can I set dialog to edit in Notepad++VanguardLH
  | |     | `* Re: [dialog] Can I set dialog to edit in Notepad++Quinn C
  | |     |  `- Re: [dialog] Can I set dialog to edit in Notepad++bill
  | |     `* Re: [dialog] Can I set dialog to edit in Notepad++Bernd Rose
  | |      `* Re: [dialog] Can I set dialog to edit in Notepad++bill
  | |       `* Re: [dialog] Can I set dialog to edit in Notepad++Bernd Rose
  | |        `* Re: [dialog] Can I set dialog to edit in Notepad++bill
  | |         +* Re: [dialog] Can I set dialog to edit in Notepad++Bernd Rose
  | |         |`* Re: [dialog] Can I set dialog to edit in Notepad++bill
  | |         | `- Re: [dialog] Can I set dialog to edit in Notepad++Bernd Rose
  | |         `* Re: [dialog] Can I set dialog to edit in Notepad++bill
  | |          `- Re: [dialog] Can I set dialog to edit in Notepad++Quinn C
  | `* Re: [dialog] Can I set dialog to edit in Notepad++Kerr-Mudd, John
  |  `* Re: [dialog] Can I set dialog to edit in Notepad++bill
  |   `- Re: [dialog] Can I set dialog to edit in Notepad++Kerr-Mudd, John
  +* Re: [dialog] Can I set dialog to edit in Notepad++VanguardLH
  |`- Re: [dialog] Can I set dialog to edit in Notepad++bill
  `* Re: [dialog] Can I set dialog to edit in Notepad++Quinn C
   `* Re: [dialog] Can I set dialog to edit in Notepad++bill
    +* Re: [dialog] Can I set dialog to edit in Notepad++Bernd Rose
    |`* Re: [dialog] Can I set dialog to edit in Notepad++Quinn C
    | `- Re: [dialog] Can I set dialog to edit in Notepad++bill
    `* Re: [dialog] Can I set dialog to edit in Notepad++VanguardLH
     `* Re: [dialog] Can I set dialog to edit in Notepad++Bernd Rose
      `* Re: [dialog] Can I set dialog to edit in Notepad++bill
       `* Re: [dialog] Can I set dialog to edit in Notepad++VanguardLH
        +* Re: [dialog] Can I set dialog to edit in Notepad++Adam H. Kerman
        |+* Re: [dialog] Can I set dialog to edit in Notepad++Sn!pe
        ||`* Re: [dialog] Can I set dialog to edit in Notepad++Adam H. Kerman
        || +- Re: [dialog] Can I set dialog to edit in Notepad++Sn!pe
        || +- Re: [dialog] Can I set dialog to edit in Notepad++Quinn C
        || `- Re: [dialog] Can I set dialog to edit in Notepad++VanguardLH
        |+* Re: [dialog] Can I set dialog to edit in Notepad++Lewis
        ||+* Re: [dialog] Can I set dialog to edit in Notepad++Adam H. Kerman
        |||`- Re: [dialog] Can I set dialog to edit in Notepad++Lewis
        ||`- Re: [dialog] Can I set dialog to edit in Notepad++Quinn C
        |`- Re: [dialog] Can I set dialog to edit in Notepad++VanguardLH
        `- Re: [dialog] Can I set dialog to edit in Notepad++bill

Pages:123
Re: [dialog] Can I set dialog to edit in Notepad++

<sf6cgf$131m$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=601&group=news.software.readers#601

  copy link   Newsgroups: news.software.readers
Path: i2pn2.org!i2pn.org!aioe.org!K1S+luz2Y1Bv8u/5kuUBog.user.46.165.242.75.POSTED!not-for-mail
From: bil...@spam.invalid (bill)
Newsgroups: news.software.readers
Subject: Re: [dialog] Can I set dialog to edit in Notepad++
Date: Fri, 13 Aug 2021 20:09:36 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sf6cgf$131m$1@gioia.aioe.org>
References: <sevelu$1qrk$1@gioia.aioe.org> <l01qbjvknuqe.dlg@v.nguard.lh> <sf0pg9$16vs$1@gioia.aioe.org> <20210811163605.abc503d2af7b32d36dd31e34@127.0.0.1> <sf12g8$1bn1$1@gioia.aioe.org> <aje23prjgwng.dlg@v.nguard.lh> <sf23af$18a9$1@gioia.aioe.org> <1qaeainv3x9gl$.dlg@b.rose.tmpbox.news.arcor.de> <sf3f6h$k0u$1@gioia.aioe.org> <86lyjunafj21$.dlg@b.rose.tmpbox.news.arcor.de> <70r516k5wr9t$.dlg@v.nguard.lh> <1lo779jiegvl3$.dlg@b.rose.tmpbox.news.arcor.de> <sf4ube$r5v$1@gioia.aioe.org> <an0k6nzbgcqh$.dlg@b.rose.tmpbox.news.arcor.de> <sf668m$408$1@gioia.aioe.org> <uci12ip228kn.dlg@b.rose.tmpbox.news.arcor.de>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="35894"; posting-host="K1S+luz2Y1Bv8u/5kuUBog.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.41 (51e03d8d.9.298)
X-Notice: Filtered by postfilter v. 0.9.2
 by: bill - Fri, 13 Aug 2021 18:09 UTC

On 2021-08-13, Bernd Rose <b.rose.tmpbox@arcor.de> wrote:
> In theory: You mix both scripts into one and order the commands in
> a logical way during that mixing.

I apologize I sent that last message before I saw this, as I was working
on the solution the entire time so I didn't check the newsgroup first
and we both posted at about the same time.

This works but it only works standalone:
function OnBeforeSendingMessage(var Message: TStringlist; Servername: string; IsEmail: boolean):boolean;
begin
result:=true;
message.savetofile('C:\temp\dialog.txt');
FileExecute(0,'C:\program files\notepad++\notepad++.exe','open','"C:\temp\dialog.txt"','',1,50000);
message.loadfromfile('C:\temp\dialog.txt');
end;

begin
end.

> Having the right commands at hands isn't even half of it. Placing
> such a call to an external editor in OnBeforeSendingMessage cries
> out for problems. You'd need to hit <Send> inside the 40tude Compose
> window before even beginning with editing.

Yup. I saw that. It's ok. Worse case it sends an incomplete message.
No big deal. I increased the failure time to five seconds just in case.

> You sure could add a
> return value of failure to this script, which would bring you back
> to the editor.

I tried adding the return value of false to a variety of locations.

function OnBeforeSendingMessage(var Message: TStringlist; Servername: string; IsEmail: boolean):boolean;
begin
// result:=true;
result:=false;
message.savetofile('C:\temp\dialog.txt');
FileExecute(0,'C:\program files\notepad++\notepad++.exe','open','"C:\temp\dialog.txt"','',1,5000);
result:=false;
message.loadfromfile('C:\temp\dialog.txt');
result:=false;
end;

begin
end.

No matter _where_ I put the return value of false it errors with:
"Posting article failed: Posting canceled by "OnBeforeSendingMessage" script."

> If you do not return, but send unconditionally, you
> loose the ability to cancel a post. Of course, you can add another
> inquiry ("Send or not?") to the script. But this would, again, just
> increase complexity.

I'll have to figure out how to get back to the composition window
but the return value of false just kills the process and does nothing.

> Sometimes, you may wish just to send a message without the detour
> to Notepad++. Permitting this, requires additional code. As would
> returning from Notepad++, cancelling the send, changing a bit within
> the 40tude Compose window and /then/ send.

Agreed.

> Because 40tude assigns charsets on-the-fly, your saved intermediate
> text file could have /any/ encoding. After loading the text inside
> Notepad++, you may need to adjust the encoding to avoid the creation
> of mixed-encoding texts.

That's the entire reason why I use notepad++ in the first place!
(Notepad++ has a macro to fix all inconsistent character encoding.)

> It wasn't by accident, that I initially recommended to /not/ pursue
> the approach of calling an external editor by 40tude Dialog script.
> And I /still/ strongly advise you, to leave this matter be...

I would like to experiment with it for a while to see if the dangers
outweigh the benefits (or vice versa).

I can't for the life of me figure out how to _combine_ two
OnBeforeSendingMessage scripts (I've tried every syntax guess
I could figure out and they all fail).

For now, _that_ is what I will work on because otherwise I'll
never be able to do two things in the OnBeforeSendingMessage task.

Re: [dialog] Can I set dialog to edit in Notepad++

<14putdxasapki$.dlg@b.rose.tmpbox.news.arcor.de>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=602&group=news.software.readers#602

  copy link   Newsgroups: news.software.readers
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: b.rose.t...@arcor.de (Bernd Rose)
Newsgroups: news.software.readers
Subject: Re: [dialog] Can I set dialog to edit in Notepad++
Date: Fri, 13 Aug 2021 20:54:40 +0200
Message-ID: <14putdxasapki$.dlg@b.rose.tmpbox.news.arcor.de>
References: <sevelu$1qrk$1@gioia.aioe.org> <l01qbjvknuqe.dlg@v.nguard.lh> <sf0pg9$16vs$1@gioia.aioe.org> <20210811163605.abc503d2af7b32d36dd31e34@127.0.0.1> <sf12g8$1bn1$1@gioia.aioe.org> <aje23prjgwng.dlg@v.nguard.lh> <sf23af$18a9$1@gioia.aioe.org> <1qaeainv3x9gl$.dlg@b.rose.tmpbox.news.arcor.de> <sf3f6h$k0u$1@gioia.aioe.org> <86lyjunafj21$.dlg@b.rose.tmpbox.news.arcor.de> <70r516k5wr9t$.dlg@v.nguard.lh> <1lo779jiegvl3$.dlg@b.rose.tmpbox.news.arcor.de> <sf4ube$r5v$1@gioia.aioe.org> <an0k6nzbgcqh$.dlg@b.rose.tmpbox.news.arcor.de> <sf668m$408$1@gioia.aioe.org> <uci12ip228kn.dlg@b.rose.tmpbox.news.arcor.de> <sf6cgf$131m$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: solani.org;
logging-data="32282"; mail-complaints-to="abuse@news.solani.org"
User-Agent: 40tude_Dialog/2.0.15.41 (653134d6.167.264)
Cancel-Lock: sha1:REsViuhu94hHQKvL+2A+tLT33CI=
X-User-ID: eJwFwYkBAzEIA7CVgMY84+BcvP8IlfBLz1snkQeCSlftzmAUO7qr0r7dizdPmYRvUtZ9tmuMC+5cuXpYVBRiTCmz7zn0B+QsGms=
 by: Bernd Rose - Fri, 13 Aug 2021 18:54 UTC

On Fr, 13th Aug 2021 20:09:36 +0200, bill wrote:

> FileExecute(0,'C:\program files\notepad++\notepad++.exe','open','"C:\temp\dialog.txt"','',1,50000);

FileExecute is a wrapper for ShellExecute. To understand the purpose of
each parameter you may look here:

https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea

Please note, that lpOperation and lpFile interchanged position and
FileExecute has an additional wait timer (in milliseconds) as last
parameter.

>> You sure could add a return value of failure to this script, which would
>> bring you back to the editor.
[...]
> No matter _where_ I put the return value of false it errors with:
> "Posting article failed: Posting canceled by "OnBeforeSendingMessage" script."

Correct behavior for "return:=false". It doesn't bring you back to the
Compose windows (what I meant with "editor"), but just doesn't send the
message and leaves it inside the Dialog Outbox.

>> Because 40tude assigns charsets on-the-fly, your saved intermediate
>> text file could have /any/ encoding. After loading the text inside
>> Notepad++, you may need to adjust the encoding to avoid the creation
>> of mixed-encoding texts.
>
> That's the entire reason why I use notepad++ in the first place!
> (Notepad++ has a macro to fix all inconsistent character encoding.)

Even /if/ you got this part right, you come back into 40tude Dialog at
a time, when it already decided, which charset/encoding it will announce
inside the headers. Therefore, you'd need to adjust them as well (suitable
to your text). Else the charset declaration of your message would most
likely be wrong sometimes or maybe even quite often or nearly always.

> I can't for the life of me figure out how to _combine_ two
> OnBeforeSendingMessage scripts (I've tried every syntax guess
> I could figure out and they all fail).

And we shall guess, what commands your second script contains? Or is this
just you muttering sth. in your boots? ;-)

Bernd

Re: [dialog] Can I set dialog to edit in Notepad++

<1cq70yuf479cr$.dlg@mid.crommatograph.info>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=603&group=news.software.readers#603

  copy link   Newsgroups: news.software.readers
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!feeder.cambriumusenet.nl!feed.tweaknews.nl!posting.tweaknews.nl!fx14.ams1.POSTED!not-for-mail
From: lispamat...@crommatograph.info (Quinn C)
Subject: Re: [dialog] Can I set dialog to edit in Notepad++
Newsgroups: news.software.readers
User-Agent: 40tude_Dialog/2.0.15.41
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Organization: Computers don't get me 'cause I'm non-binary
References: <sevelu$1qrk$1@gioia.aioe.org> <l01qbjvknuqe.dlg@v.nguard.lh> <sf0pg9$16vs$1@gioia.aioe.org> <20210811163605.abc503d2af7b32d36dd31e34@127.0.0.1> <sf12g8$1bn1$1@gioia.aioe.org> <aje23prjgwng.dlg@v.nguard.lh> <sf23af$18a9$1@gioia.aioe.org> <1qaeainv3x9gl$.dlg@b.rose.tmpbox.news.arcor.de> <sf3f6h$k0u$1@gioia.aioe.org> <86lyjunafj21$.dlg@b.rose.tmpbox.news.arcor.de> <70r516k5wr9t$.dlg@v.nguard.lh> <1lo779jiegvl3$.dlg@b.rose.tmpbox.news.arcor.de> <sf4ube$r5v$1@gioia.aioe.org> <an0k6nzbgcqh$.dlg@b.rose.tmpbox.news.arcor.de> <sf668m$408$1@gioia.aioe.org> <sf6aii$54t$1@gioia.aioe.org>
Message-ID: <1cq70yuf479cr$.dlg@mid.crommatograph.info>
X-Face: .f:ZE>c\~9oJ+1nK#>ntSHOQS~4x"Qx2m(<D<@p$G"tzb1lgWLUGY.zApKa@VL_?d$r(8=?VjrD9=uY:x!+H=hvj58Uw7)Y9<:KMYD.+^~#qMpeg2rvt`{#2a~7YoyFaFaBEdo4.TJzBqgtCZZ:mku4J|hey}DE}_"z(rl0N)\Pxh*0$"3B2mr\01&YPY7WJ:2kSe'I#PqiTxs1s49!S#W85'\zMXy*wRgD,,k.=4:3M{(P"i6S;\az~ut3z`;?*Y;&]11<(EPF-SN`|3PhyL%~AuZpoFjjE_oM1`znHPq_?uib2WXwE+q@m),cLq~B$r^5uO]u6?CEecn=%xsDXNVa(1DX.)O(
Cancel-Lock: sha1:wuCJWct4FNHos8WSo+AMawC0XF8=
Lines: 44
X-Complaints-To: abuse@tweaknews.nl
NNTP-Posting-Date: Fri, 13 Aug 2021 23:13:49 UTC
Date: Fri, 13 Aug 2021 19:13:47 -0400
X-Received-Bytes: 2813
 by: Quinn C - Fri, 13 Aug 2021 23:13 UTC

* bill:

> How do you get _TWO_ OnBeforeSendingMessage procedures to work sequentially?

Here's how my OnBeforeSendingMessage looks like:

program OnBeforeSendingMessage;

uses textfile, Forms, StdCtrls;

{$I Include_AddFaceHeader.ds}
{$I CancelLock_include.ds}
{$I RemoveAnyHeader_include.ds}
{$I Include_AddAnyHeader.ds}

function OnBeforeSendingMessage(var Message: TStringlist; Servername:
string; IsEmail: boolean):boolean;
begin
result:=true;

AddFaceHeader ( Message, IsEmail );
CLMain_CancelLock (Message, IsEmail);
// Remove_Headers (Message, IsEmail );
// AddAnyHeader ('X-CustomScript: AddAnyHeader', Message, IsEmail);
// AddAnyHeader ('X-ScriptMadeBy: me, myself & I', Message,
IsEmail);
// AddAnyHeader ('X-NoArchive: banter', Message, IsEmail);

end;

begin
end.

The point, the clean solution is to call other "custom scripts" from
this one.

--
No ... it's a good thing that one of the most famous bigots
in the country [now supports Bernie].
-- Page Kreisman, talking about Joe Rogan

Re: [dialog] Can I set dialog to edit in Notepad++

<2cf4nyzcfoti.dlg@b.rose.tmpbox.news.arcor.de>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=604&group=news.software.readers#604

  copy link   Newsgroups: news.software.readers
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: b.rose.t...@arcor.de (Bernd Rose)
Newsgroups: news.software.readers
Subject: Re: [dialog] Can I set dialog to edit in Notepad++
Date: Sun, 15 Aug 2021 14:23:41 +0200
Message-ID: <2cf4nyzcfoti.dlg@b.rose.tmpbox.news.arcor.de>
References: <sevelu$1qrk$1@gioia.aioe.org> <1dtmjo6u9vzl1$.dlg@b.rose.tmpbox.news.arcor.de> <sf0olp$qvr$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: solani.org;
logging-data="2154"; mail-complaints-to="abuse@news.solani.org"
User-Agent: 40tude_Dialog/2.0.15.41 (2787fb44.66.493)
Cancel-Lock: sha1:0tSrHXKKUbayORGJl/qDt19ObJQ=
X-User-ID: eJwNyskBwCAIBMCWzMKCloMc/ZcQf/MYin2WrkZTDifbmsRslVtEbCfy1kAGsWadbhbek6zpCFV6iN0J0LDs1GafBX1ypPz6rRpZ
 by: Bernd Rose - Sun, 15 Aug 2021 12:23 UTC

Am Wed, 11th Aug 2021 17:00:23 +0200, bill wrote:

[Use external editor (Notepad++) for editing follow-ups]
> On Wed, 11 Aug 2021 06:05:21 +0200, Bernd Rose wrote:
>> It is possible per script [...]. But the whole process would
>> be somewhat difficult to implement and probably not seem seamless
>> enough for a good usage experience.
>
> I'm not a script writer so unless the script exists (or a similar modifiable
> script exists)

All approaches we discussed until now, are either not to your liking
or, IMHO, rather dangerous. - But you got me curious... ;-)

Although the script capabilities of 40tude Dialog are extraordinary, they
still have their limitations. Often it is possible to circumvent problems
by calling system function. In your case, this would rather complicate
things, though.

Of all Event scripts, only OnBeforeSendingMessage deals to some degree with
the composition window. Actually, it rather deals with a text message, right
after the Composition window is disposed off, but before this message is
sent. This makes it possible, to add some checks and changes right before
sending. But everything altered will be either sent without 40tude Dialog
doing additional checks; or it will be discarded and +/- lost.

The same is true for Message scripts. All objects and their messages, which
are accessible this way, target (only!) the main Dialog window. The Compose
window is out of the scope of Messages scripts.

Even Custom scripts can only be assigned hotkeys of the main Dialog window,
and /not/ be executed from Composition window.

So, everything dealing with calling an external editor has to be initiated
from the main 40tude Dialog Window. This also means, it is not possible
(without diving in the innermost system functions for process and window
enumeration and the like) to open the follow-up inside the Composition
window, save the text from there, edit it externally and come back to that
Composition window for reloading the altered text and final processing.

The way I chose is:
1) Load currently selected message (cf. Article pane) to memory buffer
2) Add quote chars in front of each line of the buffer. (Usually, this
step would be done by 40tude Dialog while loading the text into the
Composition window. But, unfortunately, we are about to circumvent
this step right now.)
3) Save the buffer to disk
4) Open Notepad++ (or another editor) with the saved temporary file
5) Block 40tude Dialog with a message box
6) Wait for the message box to be closed after the file has been edited,
externally, and saved back to disk.
7) Fire up the 40tude Composition window (as follow-up to the still current
message)
8) Reload the file from disk into the Composition window, replacing the
whole text, save the first two lines (intro plus one empty line) by
stuffing the keyboard buffer. (= The only way without Windows system
functions to access the Composition window per script.)

Now the text is ready for final editing (inserting wrap override characters,
adding a suitable signature, and the like). Afterwards, the message can be
sent (or aborted), normally.

The script itself can be created as Custom script (to be assigned to a
keyboard shortcut) or as a Message script. Only few alterations have to be
done, to go from one to the other. Both methods performed well during my
tests. It should be clear, though, that the script performs only the most
basic error checks. Therefore, it may fail at any time. (More refined
error testing would preoccupy far more hours, then I care to spend on this
matter.) - You have been warned! ;-)

And now for the script: Following is the Message script variant. I chose
to assign it to a mouse middle button double click inside the Article pane.
This way, it is clear, that it targets the current article.

To load it, choose the "Message scripts" tab from 40tude Dialog Scripting
Editor, create a new script and select:

Control: BODYEDIT
Message: WM_MBUTTONDBLCLK

Then replace the script stub with the following code. Adjust the entries
in the "const" section at the top of the script to your preferences and
system settings. Then save and compile the script, and you are ready to go.

Have fun!
Bernd

--------------------------------------------------------------------------

// Script for opening the current message in an external editor
// and getting the edited text back as Follow-Up into the 40tude
// Composition Window
//
// Adjust settings in the 'const' section on top of the script
//
// Author: Bernd Rose | Version: 2021-08-15 | Public Domain

program BODYEDIT_WM_MBUTTONDBLCLK;
uses Forms, StdCtrls, Textfile;

const
// Edit settings here:
ExtEditor = 'C:\Program Files\Notepad++\Notepad++.exe';
TmpFile = 'C:\Temp\dialog.txt';
bSkipIntro = True;
QuoteChrs = '>|';
QuoteChr = '>';
// End of editable section

procedure OnWMessage(var Msg:TMessage;var handled:boolean);

var
TmpForm: TForm;
TmpMemo: TMemo;
TextF: Textfile;
i: Integer;

begin
TmpForm := TForm.Create(Nil);
TmpMemo := TMemo.Create(TmpForm);
TmpMemo.parent := TmpForm;
TmpMemo.WordWrap := True;
TmpMemo.Scrollbars := ssBoth;

lockdisplay;

try
TmpMemo.Clear;
ADo('ArticlePane');
ADo('SelectAll');
Ado('Copy');
TmpMemo.PasteFromClipboard;

// Insert quotation char in the first position of every line
begin
i := 0;
while i <= TmpMemo.Lines.count - 1 do
begin
// Check for empty lines (need special treatment)
if TmpMemo.Lines[i] <> '' then
if Pos(TmpMemo.Lines[i][1], QuoteChrs) > 0 then
begin
// Quote an already quoted line
TmpMemo.Lines[i] := QuoteChr + TmpMemo.Lines[i];
end
else
begin
// New quotes are padded with a space character
TmpMemo.Lines[i] := QuoteChr + ' ' + TmpMemo.Lines[i];
end
else
// Append empty line, as well, to get correct line endings
TmpMemo.Lines[i] := QuoteChr + TmpMemo.Lines[i];
i := i + 1;
end;
end;

AssignFile(TextF, TmpFile);
Rewrite(TextF);
TextWrite(TextF, TmpMemo.text);
CloseFile(TextF);

//PostKey( key: Word; Shift, Alt, Ctrl, Left, Right, Middle, Double,specialkey: Boolean);
PostKey(36, false, false, true, false, false, false, false, false);

unlockdisplay;

FileExecute(0,ExtEditor,'open',TmpFile,'',1,0);

// Access to 40tude Dialog is suspended until return from external editor
if Application.MessageBox('Hit <OK> when the external edit process is finished.',
'Waiting...', 65) = 1 then
begin
TmpMemo.Clear;
TmpMemo.Lines.LoadFromFile(TmpFile);
TmpMemo.SelectAll;
TmpMemo.CopyToClipboard;

ADoLater('FollowUpToUsenetMessage');

if bSkipIntro then
begin
// Go to top, then 2 lines down and select message text to the end
PostKey(36, false, false, true, false, false, false, false, false);
PostKey(40, false, false, false, false, false, false, false, false);
PostKey(40, false, false, false, false, false, false, false, false);
PostKey(35, true, false, true, false, false, false, false, true);
end
else
begin
// Select all
PostKey(65, false, false, true, false, false, false, false, false);
end;

// Paste Clipboard content (overwriting selection); then go to top
PostKey(86, false, false, true, false, false, false, false, false);
PostKey(36, false, false, true, false, false, false, false, false);
end;

finally
TmpForm.free;
end;

end;

begin
end.

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor