Notifications
Clear all

[Closed] Callbacks being ignored

I have callbacks set up for when I merge a file, but when I merge a file through script the callbacks seem to be ignored.

Any idea why this is happening, and if there is a workaround?

Thanks!

1 Reply

First of all, it sounds like you haven’t confirmed that they are not executing. If you haven’t done this, put some print commands (i.e. print “XcallbackStarting” and print “XcallbackEnding”) in your callback to confirm whether they are being triggered. If you don’t see these strings appearing in the Listener, then you know they aren’t being triggered.

Second, this might be the designed behavior of callbacks not to be triggered by script-initiated merges? (I’m actually not sure about this.) As a workaround, I would suggest that you simply remove the callbacks prior to your script-based merge, then directly execute the function/string that your callback would normally execute, and finally rebuild the callbacks after your merge code is finished. I’ve had to do this on a PreRender/PostRender pair of callbacks in my script…works very well.