ConsoleMenuCommand

This forum is for discussing Mailtraq's Scripting features. Get help with Mailtraq scripts, templates and external ActiveX scripting.

ConsoleMenuCommand

Postby mpolak » Thu Mar 09th, 2017 11:52am

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
mpolak
 
Posts: 8
Joined: Tue Aug 17th, 2010 3:24pm

Re: ConsoleMenuCommand

Postby Martin Clayton » Thu Mar 09th, 2017 12:37pm

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.
User avatar
Martin Clayton
Expert User
 
Posts: 527
Joined: Sat Jan 15th, 2005 8:20am
Location: London, UK

Re: ConsoleMenuCommand

Postby mpolak » Thu Mar 09th, 2017 3:03pm

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.
mpolak
 
Posts: 8
Joined: Tue Aug 17th, 2010 3:24pm

Re: ConsoleMenuCommand

Postby Martin Clayton » Thu Mar 09th, 2017 3:33pm

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...
User avatar
Martin Clayton
Expert User
 
Posts: 527
Joined: Sat Jan 15th, 2005 8:20am
Location: London, UK

Re: ConsoleMenuCommand

Postby mpolak » Thu Mar 09th, 2017 4:30pm

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.
mpolak
 
Posts: 8
Joined: Tue Aug 17th, 2010 3:24pm

Re: ConsoleMenuCommand

Postby Martin Clayton » Fri Mar 10th, 2017 8:54am

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).
User avatar
Martin Clayton
Expert User
 
Posts: 527
Joined: Sat Jan 15th, 2005 8:20am
Location: London, UK

Re: ConsoleMenuCommand

Postby mpolak » Fri Mar 10th, 2017 6:45pm

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.
mpolak
 
Posts: 8
Joined: Tue Aug 17th, 2010 3:24pm

Re: ConsoleMenuCommand

Postby Martin Clayton » Sat Mar 11th, 2017 7:58am

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.
User avatar
Martin Clayton
Expert User
 
Posts: 527
Joined: Sat Jan 15th, 2005 8:20am
Location: London, UK

Re: ConsoleMenuCommand

Postby mpolak » Sat Mar 11th, 2017 5:57pm

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
mpolak
 
Posts: 8
Joined: Tue Aug 17th, 2010 3:24pm


Return to Mailtraq Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron