How to see AppleEvents in Dialog Toolkit?

I’m completely new to Script Debugger, so my apologies if I’m overlooking something obvious.

I’d like to see the AppleEvents generated by some of the code in Dialog Toolkit. So I opened the source code for it in ScriptDebugger and appended the simplest example for Enhanced Window from the ZIP file to it. Clicking on “Run” works just fine.

However, when I activate “Debugging” and set a breakpoint on one of the lines in the Dialog Toolkit source, running the code gives me an error -34000 (for which I found no explanation anywhere).

Most of the code in that library uses AppleScriptObjC, which is run internally by AppleScript, so there are no Apple events involved.

Unfortunately, variables that contain Cocoa objects – so most AppleScriptObjC variables – are incompatible with debugging, due to a limitation of AppleScript.

Wow, that was fast. Thanks! I feared as much … So no luck here.

Background: I was hoping to figure out how to rewrite the code in JavaScript-ObjC. Which kind of works but for the performSelectorOnMainThread calls. Alternatively, I’d call the library code from JXA, but that results in the error message

 execution error: Error: Error: item 1 of reverse of {«class ocid» id «data optr00000000A0AC74E5A57F0000» of «script», «class ocid» id «data optr00000000C0A0A3E6A57F0000» of «script», «class ocid» id «data optr00000000805582E6A57F0000» of «script»} doesn't understand the message „frame“. (-1708)

when calling displayEnhancedWindow. That had been reported here before…