I have a Python scripting tool that will auto-export a layout to PDF or JPG, update a text box with the export YYMMDDHHMMSS, and log who-what-where-when info to a CSV file. I have been using this code in ArcGIS for years and recently upgraded the tool to work with Pro.
Oddly, the Pro tool works just fine when executed from the Toolbox section of the Catalog View but fails at line 50 when executed from a Catalog Pane. Why would this be the case?
Here is the error message:
PYTHON ERRORS:
Traceback info:
File "Z:\GISpublic\GerryG\Python3\SuperSaverArcPro\A1-SuperSaver.atbx#Script_supersaver.py", line 51, in <module>
Error Info:
'NoneType' object has no attribute 'listElements'
and here is the offending code:
mapnumber = get_time()
#Get the name of the active map view....
view = aprx.activeView
ele = view.listElements("TEXT_ELEMENT", "mapnumber")[0]
#assign the mapnumber to the map....
ele.text = mapnumber Here is a link to the tool and the code:
https://github.com/LummiGIS/Auto-Export-Pro-Layout