Pages: 1
Print
Author Topic: Some (all?) event macros not executed  (Read 2052 times)
hhvmetaal
Member

Posts: 3


« on: March 16, 2015, 04:12:34 PM »

Hi,

I am using Author Enterprise 9.0.0.053. I have a .mcr file in which some or all event macro's are executed (e.g. I have added a pre-save-file macro). To verify if anything at all is executed I added a macro with a shortcut-key at the end. When I press the shortcut the macro is executed, so the .mcr file is successfully read and processed. (I had the experience that due to syntax errors the .mcr file would simply not be loaded or partially loaded. So having a working macro at the end to verify the .mcr file is still working helps.)

Anyway, without going into detail I was just wondering if others have seen this behavior and know what I am doing wrong.

Thanks,

Huib Verweij.
Logged
barbwire
Member

Posts: 44


« Reply #1 on: March 17, 2015, 01:49:47 AM »

Well, usually I use alert boxes inside macros so I know where it is broken if it does not work. If somebody know better way to "debug" please tell me.
Code:
Application.Alert("Foobar");
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #2 on: March 17, 2015, 01:42:43 PM »

It likely won't help in this case though. It sounds like the macro(s) is not even being triggered, so an alter (or debugger statement) won't even be triggered.

I think I'd have to see a complete MCR file to figure out what's going wrong here. It would be best to submit that to XMetaL Support.

@barbwire -- Put this at the start of any JScript Macro (or a later position where you want debugging to begin):
Code:
debugger;

You need a debugging environment for that to be useful though. If you don't have Visual Studio or another similar environment then you can get the Microsoft Script Debugger here: http://www.microsoft.com/en-us/download/details.aspx?id=22185

Debugging with alerts can be helpful for simple scripts and many people get by OK using this method, but debugging can be vastly more powerful and effective. All debugging tools let you step through the script line by line, and some let you set break points, check values of variables and properties, expand an object to view all of its available properties and methods, alter variable values and continue execution, and other things.
Logged
Pages: 1
Print
Jump to:  

email us