A lot of examples in the API documentation include examples that start with this code
import PhotoScan
doc = PhotoScan.app.document
However in version 1.2.2 this is not working for me, the result in doc is empty and I cannot invoke any methods on it. I get the error:
2016-01-14 10:56:50 AttributeError: 'NoneType' object has no attribute 'save'
However, if I enter the command directly into the console it works.