Debugging a script is a nightmare. Which is the best way to do it?. Are there any tools (maybe third party ones) that can help?
Does anyone know if ABBYY has plans to improve on this topic?
Script debugger is #1 in my wishlist.
Does anyone know if ABBYY has plans to improve on this topic?
Script debugger is #1 in my wishlist.
コメント
3件のコメント
Scripts from document definition ( rules, custom actions, export profiles, auto-correction scripts etc. ) can be debugged easily if they are written in COM-languages ( JScript or VBScript ). Just put a standard script breakpoint in script body ( "stop" for VBScript or "debugger" for JScript ) and during script execution your debugger will suggest you to debug the script ( just check that Tools -> Options -> Document Processing -> Disable External Script Debugging is turned OFF ).
As for event handlers or custom stages, then some of them can be debugged in this way and some others can be not. For user-interactive scripts ( like "on user command" event handler) you may use FCtools.ShowMessage for debugging. Noninteractive scripts ( like "document processing script" for example ) usually have access to IProcessingCallback interface, which allows you to write custom messages into task log. You can see the log on processing server monitor by double-clicking on the task record.
Finally, ANY script can be debugged if it is written in .NET and implemented as a call of external component, for example class library. It is assumed that code of the component is created in Visual Studio. And the code should contain a System.Diagnostics.Debugger.Break() function call as a breakpoint. In script body you just create an instance of your custom class and call a method of this class with some input parameters. So, the whole script body will be just a couple of lines. And the script body does not contain breakpoints. Then you should use "Attach to process" functionality in Vusual Studio to attach to FlexiCapture process before script execution. And when script will be executed, Visual Studion will be able to debug your component.
サインインしてコメントを残してください。