🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #265138

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

#265138
From: bill
Date: Fri, 13 Aug 2021 17:36
79 lines
4339 bytes
On Fri, 13 Aug 2021 18:23:02 +0200, bill wrote:
> After changing the program below from "korrnews" to "notepad++", 
> since I already have an OnBeforeSendingMessage script, do I just 
> concatenate this after the existing OnBeforeSendingMessage script?

Every time I try to put TWO functions inside of OnBeforeSendingMessage 
I fail because I don't know how to put the two functions together into 
OnBeforeSendingMessage.

Anyway, the original program originally failed but I got it to work standalone.
It has a dubious benefit that it seems to also allow header edits.
(Editing headers would be risky, at best, I would think.)

*But I can't get it to work with my _existing_ OnBeforeSendingMessage.*

But standalone it works.

Here's where I am where I started with this.
http://web.archive.org/web/20120127150159/http://dialog.datalist.org/scripts/ScriptSaveOutboundMessage.html

program OnBeforeSendingMessage;

function OnBeforeSendingMessage(var Message: TStringlist; Servername: string; IsEmail: boolean):boolean;
begin
result:=true;
message.savetofile('C:\temp.txt');
//give korrnews 5000 milliseconds for this, otherwise give up
FileExecute(0,'F:\Korrnews\korrnews.exe','open','Type:news Filename:"C:\temp.txt"','',1,5000);
message.loadfromfile('C:\temp.txt');
end;

begin
end.

I first changed that to point to a different file and editor.

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','Type:news Filename:"C:\temp\dialog.txt"','',1,5000);  
message.loadfromfile('C:\temp\dialog.txt');
end;

begin
end.

That gave the following errors, in 1,2,3 sequence.

"C:\program files\dialog\Type:news" doesn't exist. Create it?
"C:\program files\dialog\Filename" doesn't exist. Create it?
Cannot create the file "C:\program files\dialog\Filename".

So I changed the program to this (which worked without errors).
[Notice I completely removed "Type:news Filename:" to make it work.]

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.

That works perfectly - but only when it's the only OnBeforeSendingMessage script.
1. The Dialog composition window comes up.
2. When I select Dialog's Action->Send Now it opens it in Notepad++.
3. When I save and exit Notepad++ only then does it send the message.

So it works but I _already_ have an OnBeforeSendingMessage script.
I can't for the life of me figure out the syntax of combining the two.

Can you give me a hint how to get it to work with my existing "OnBeforeSendingMessage"?
I already tried all the ways of moving the "begin/end" stuff around.

How do you get _TWO_ OnBeforeSendingMessage procedures to work sequentially?
Technical Details
Message-ID: <sf6aii$54t$1@gioia.aioe.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
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>

Show Full Headers
Complete Article Headers
Message-ID: <sf6aii$54t$1@gioia.aioe.org>
Subject: Re: [dialog] Can I set dialog to edit in Notepad++
Date: Fri, 13 Aug 2021 19:36:34 +0200
From: bill <bill@spam.invalid>
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>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Content-Type: text/plain; charset="us-ascii"
User-Agent: 40tude_Dialog/2.0.15.41 (51e03d8d.9.298)
Newsgroups: news.software.readers
Mime-Version: 1.0
Organization: Aioe.org NNTP Server
Content-Transfer-Encoding: 7bit
X-Notice: Filtered by postfilter v. 0.9.2