Thread View: news.software.readers
4 messages
4 total messages
Started by Ted S.
Sat, 23 Aug 2008 16:16
[Dialog] Scripting help
Author: Ted S.
Date: Sat, 23 Aug 2008 16:16
Date: Sat, 23 Aug 2008 16:16
30 lines
2205 bytes
2205 bytes
Dialog's help for scripting includes the following: <snip> OnBeforeSendingMessage Called from a worker thread right before a message is sent to a SMTP or NNTP server. You could change the contents or formatting of the message from within this script. </snip> This is something I've been wanting to take advantage of for a while. But I can't get even a simple script to work. I tried: <snip> if (Subject: packfans) function StringReplace( S, User-Agent: 40tude_Dialog/2.0.15.1, User-Agent: FavreMail Express, Version 4: string; Flags: TReplaceFlags): string; </snip> However, I get an error message on trying to run the script about the if block. All I did was to add the if and function blocks between what Dialog already had in there. I have no idea what to do, and reading Dialog's help page on scripts is like reading gibberish. -- Ted S. fedya at hughes dot net Now blogging at http://justacineast.blogspot.com
Re: [Dialog] Scripting help
Author: Sqwertz
Date: Sat, 23 Aug 2008 17:15
Date: Sat, 23 Aug 2008 17:15
39 lines
2796 bytes
2796 bytes
"Ted S." <fedya@hughes.spam> wrote: > Dialog's help for scripting includes the following: > > <snip> > OnBeforeSendingMessage > Called from a worker thread right before a message is sent to a SMTP or > NNTP server. You could change the contents or formatting of the message > from within this script. > </snip> > > This is something I've been wanting to take advantage of for a while. > But I can't get even a simple script to work. I tried: > > <snip> > if (Subject: packfans) > function StringReplace( S, User-Agent: 40tude_Dialog/2.0.15.1, > User-Agent: FavreMail Express, Version 4: string; Flags: TReplaceFlags): > string; > </snip> > > However, I get an error message on trying to run the script about the if > block. All I did was to add the if and function blocks between what > Dialog already had in there. > > I have no idea what to do, and reading Dialog's help page on scripts is > like reading gibberish. You're missing the 'begin' and 'end;' block, at the least. Take a look at the Dialog script library to get some examples of how other people have implemented the OnBeforeSendingMessage event. Scripts such and changing headers will all rely on OnBeforeSendingMessage. http://dialog.datalist.org/scripts/script_library.html Of particular interest would be: http://dialog.datalist.org/scripts/CustomizeUserAgent.html -sw
Re: [Dialog] Scripting help
Author: Ted S.
Date: Sun, 24 Aug 2008 02:42
Date: Sun, 24 Aug 2008 02:42
24 lines
2157 bytes
2157 bytes
On Sat, 23 Aug 2008 12:15:20 -0500, Sqwertz wrote: > You're missing the 'begin' and 'end;' block, at the least. I didn't make it entirely clear, but the few lines I quoted in my post were what I added to what was already there, which included a 'begin' and 'end' block. > Take a > look at the Dialog script library to get some examples of how other > people have implemented the OnBeforeSendingMessage event. Scripts > such and changing headers will all rely on OnBeforeSendingMessage. > > http://dialog.datalist.org/scripts/script_library.html > > Of particular interest would be: > http://dialog.datalist.org/scripts/CustomizeUserAgent.html Oh, dear. This code is way above my head. :-( -- Ted S. fedya at hughes dot net Now blogging at http://justacineast.blogspot.com
Re: [Dialog] Scripting help
Author: Sqwertz
Date: Sun, 24 Aug 2008 04:11
Date: Sun, 24 Aug 2008 04:11
35 lines
2677 bytes
2677 bytes
"Ted S." <fedya@hughes.spam> wrote: > On Sat, 23 Aug 2008 12:15:20 -0500, Sqwertz wrote: > >> You're missing the 'begin' and 'end;' block, at the least. > > I didn't make it entirely clear, but the few lines I quoted in my post > were what I added to what was already there, which included a 'begin' > and 'end' block. > >> Take a >> look at the Dialog script library to get some examples of how other >> people have implemented the OnBeforeSendingMessage event. Scripts >> such and changing headers will all rely on OnBeforeSendingMessage. >> >> http://dialog.datalist.org/scripts/script_library.html >> >> Of particular interest would be: >> http://dialog.datalist.org/scripts/CustomizeUserAgent.html > > Oh, dear. This code is way above my head. :-( Object Pascal is not a pretty language. You can at least see that you're missing the begin/end within your 'if' block. It's not like C where you can have a single command following an 'if' without blocking it. Also, function declarations liek you're trying to use should probably happen outside of any nested blocks of code (not within an 'if' statment). But I'm no expert in the language. That's just usually how it works. -sw
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads