Page 1 of 1

ConsoleMenuCommand

PostPosted: Thu Mar 09th, 2017 11:52am
by mpolak
Hi!

I recently switched from MTQ 2.15 on Windows XP 32 bit (old console) to MTQ 2.17 on Windows 7 64 bit (MMC console). Now it seems that ConsoleMenuCommand("Collect News") doesn't work any more. In the log, there are error messages like this:

0000C000 000008C4 09.03.2017 16:19:34 EXCEPTION (Access violation at address 00B489E5 in module 'MailtraqService.exe'. Read of address 00000368) @ Executing Automatic Script "News von Hamster holen" (007479E5){MailtraqService.exe} [00B489E5] templts.ConsoleCommandFunction (Line 1101, "Templts.pas" + 3) + $21

Is that a known issue? Can I make it work again?


Regards,
Manfred

Re: ConsoleMenuCommand

PostPosted: Thu Mar 09th, 2017 12:37pm
by Martin Clayton
Hi Manfred

mpolak wrote:(old console) to MTQ 2.17 on Windows 7 64 bit (MMC console). Now it seems that ConsoleMenuCommand("Collect News") doesn't work any more.


I suspect it's not available under MMC.

The Tools > Execute Script scripting environment has a suitable function;
Code: Select all
Server.StartNewsCollection();


... available in a scheduled script via the Mailtraq object:

Code: Select all
<@LANGUAGE=Javascript@>
<%
   Mailtraq.StartNewsCollection();
%>


Hope this helps.

Re: ConsoleMenuCommand

PostPosted: Thu Mar 09th, 2017 3:03pm
by mpolak
Hi Martin

Thanks for your reply, but I don't get it working. Is VBScript/Javascript only available in the Professional Edition? I just have the Essential Edition, and I only get more error messages with that Javascript that you posted.

Re: ConsoleMenuCommand

PostPosted: Thu Mar 09th, 2017 3:33pm
by Martin Clayton
I only briefly tested 'Professional with Proxy' .3566 (multi-domain) and I'm not sure on the differences between versions.

If you can access Tools > Execute
Clear the window
Enter Server.StartNewsCollection();
Hit Script > Execute

The log should show connection attempt(s).

If that works I suspect a scheduled script will work...

Re: ConsoleMenuCommand

PostPosted: Thu Mar 09th, 2017 4:30pm
by mpolak
It works if I start it from the Tools menu, but it doesn't work as a scheduled script. The script is executed, but nothing happens.

Re: ConsoleMenuCommand

PostPosted: Fri Mar 10th, 2017 8:54am
by Martin Clayton
mpolak wrote:It works if I start it from the Tools menu, but it doesn't work as a scheduled script. The script is executed, but nothing happens.


If you're seeing an appropriate "Executing Automatic Script" log entry, it's looking like a version restriction. To rule out news issues (no active hosts...), try scheduling this test script:

Code: Select all
<@LANGUAGE=Javascript@>
<%
    // Mailtraq.StartNewsCollection();

    // log entry with LogInfo class (hex: 00010000)
    Mailtraq.Log('DEBUG: Script Test. Mailtraq object says Yes', 65536);

%>


If you're using the log viewer make sure it's set to show 'Information' messages. (The disk log never fails).

Re: ConsoleMenuCommand

PostPosted: Fri Mar 10th, 2017 6:45pm
by mpolak
Martin Clayton wrote:
If you're seeing an appropriate "Executing Automatic Script" log entry, it's looking like a version restriction.


Yes, I see that log entry, and I guess it's really a version restriction. Unfortunately, there seems to be no detailed description of the differences between Essential and Professional Edition.

To rule out news issues (no active hosts...), try scheduling this test script:


Well, Javascript and VBScript don't work here. I get error messages like that. And it's a Mailtraq issue, because WSH scripts work fine here.
But I'm sure there are no news issues. MTQ connects to another local server (Hamster), and the Hamster GUI shows if the connection is successful. There are no problems if I use the menu Tools - Collect News. It's just a script issue.

I found this old posting by Elric Pedder from Mailtraq/Fastraq (I don't know if he is still around). According to Elric, VBScript and Javascript is only available in the Plus and Standard editions, which became the Professional Edition. The Essential Edition (which was called Mailtraq Lite when I purchased it in 1998) is excluded, and perhaps this is also the case for your suggestion Server.StartNewsCollection(), which works via Tools - Execute Script, but not as a scheduled script.

Re: ConsoleMenuCommand

PostPosted: Sat Mar 11th, 2017 7:58am
by Martin Clayton
mpolak wrote:Well, Javascript and VBScript don't work here. I get error messages like that.

Probably moot...

Trying to access the Mailtraq object wont work under the Tools > Execute Script remote scripting environment (it's a gateway for standalone/scheduled scripts). Here, you'd use Server.Log("DEBUG: hello world"); but that wont test whether the Mailtraq object is accessible to the standalone scripts that we want to schedule.

mpolak wrote:I found this old posting by Elric Pedder from Mailtraq/Fastraq (I don't know if he is still around). According to Elric, VBScript and Javascript is only available in the Plus and Standard editions, which became the Professional Edition.

Well found (and quoted), so, yes, it's looking like a version restriction.

mpolak wrote:Server.StartNewsCollection(), which works via Tools - Execute Script, but not as a scheduled script.

(As above, standalone/scheduled it would have to be Mailtraq.StartNewsCollection();)

Mailtraq's DDE support provides another way in and I believe use is not version-restricted. See Jim Hill's perl based test...

Code: Select all
use Win32::DDE::Client;
use strict;
use warnings;

my $Client = new Win32::DDE::Client 'MAILTRAQ', 'MAILTRAQ';
die "Unable to initiate conversation" if ($Client -> Error);

print "Client = ".$Client."\n";
print "Initiate = ".Win32::DDE::ErrorText ($Client -> Error)."\n";

$Client -> Execute('RUNSCRIPT MessageDlg("Hello World")') or die "DDE execute failed";
print "Execute = ".Win32::DDE::ErrorText ($Client->Error)."\n";

$Client->Disconnect;


I'll have a look at a windows/javascript version in a few days if you're interested.

Re: ConsoleMenuCommand

PostPosted: Sat Mar 11th, 2017 5:57pm
by mpolak
I think I better give up now and switch to a solution which bypasses MTQ in my newsgroups installation. Hamster has an OLE interface, and re-writing 2 or 3 MTQ scripts in VBScript will solve my problems, whereas MTQ will be restricted to mail from now on.

Martin, many thanks for your patience and knowledge! Best regards,

Manfred