Skip to main content
Known Participant
August 5, 2005
Question

How to debug a callback function?

  • August 5, 2005
  • 2 replies
  • 624 views
I have a function hooked up to a menu item in Bridge. So far, I've been unable to get the ExtendScript debugger to set a breakpoint in that script and/or step through it. How would I set it up to do that?

My function is loading in the startup directory. It's got a #target "bridge" in the file and $.level = 1; The startup code runs properly and installs the menu item. The callback is executed when I pick the menu item. But, I can't get the debugger to capture the callback function.

--John
This topic has been closed for replies.

2 replies

Known Participant
August 5, 2005
OK, I didn't realize you have to put a debugger; command in the startup code in order to be able to set other breakpoints. That is working. Thanks.

I had worked around it after my post by putting a debugger command where I wanted a breakpoint and that was getting me into the debugger, but this is cleaner to put debugger in the startup and then set whatever breakpoints you want.

--John
Known Participant
August 5, 2005
I don't have any trouble doing that. In general, the debugger works on callbacks, scheduled tasks, even across applications.

Just to be certain:

did you use a "debugger" statement?

$.level = 1; // enables the debugger, in break on error mode

$.level = 1;
debugger; // launches debugger

You can also use

$.level = 2;