This script: Document pixel position under cursor position
The reason why pobj is None is because there is no widget with the name “view_0” in the object tree. This happens because “view_0” was already closed. The first document opened on application startup is “view_0”. When the document is closed, “view_0” no longer exists. The second document will have “view_1” and the third document will have “view_2” and so on.
The script was a proof of concept. This code should be more robust.