[Photoshop] Active Document Callback?

Is there a way to trigger a callback when the user changes the active document?
Thanks.

https://forums.adobe.com/thread/1380138

thanks! now I just need to get this working with Python and comtypes…

also I should note I am using photoshop version 12 (CS5)

Do you where I can find documentation on CSInterface? It doesn’t appear in any of Adobe’s official Photoshop scripting guides…