While coding with the printtopdf statement, I found a way to completely hang Pan X.
Passing it a bad Path (such as “/filename.pdf”) caused an error dialog to appear, and the OK button was ineffective. I had to Force quit. This happened multiple times (until I finally got my Path straightened out).
The Preparing… dialog in the background was busy, but never finished.
The PrintToPDF statement actually checks for a valid path before trying to generate the PDF, but it turns out the macOS API it uses to check the path has a bug in it and thinks that / is a valid folder. So most bad paths will simply cause an error, but you’ve found one particular case that doesn’t work. I’ve added a special case in Panorama’s code to work around Apple’s bug, so in the future, you’ll get an error message in this situation also. Thanks for the report.