I guess you must have figured that out by trial and error. FYI, that solution is only going to work with your specific brand of printer. The _PrintSettings is an opaque, undocumented data structure that Panorama knows nothing about. macOS gives Panorama the value and says “please save it for later and give it back to me the next time you print.” I believe that macOS itself doesn’t even know anything about the paper tray – that part is handled by the printer driver.
The old, “classic” version of MacOS (that Panorama 6 runs under) required each application to store the printer settings somewhere. Panorama 6 did that with the _PrintSettings variable. In OS X/macOS, the operating system handles this in the standard document format, so Panorama doesn’t need to keep it’s own _PrintSettings variable. There is no way to access the settings from within Panorama. However, the settings are saved with the database. If you right click on a Panorama database and choose Show Package Contents, you’ll see that it contains a file named printinfo.archive. This contains the printer settings. This file contains text, you can open it with BBEdit. I tried printing with a custom paper tray and saving the document. I have a Brother printer, it appears that the driver for that printer saves information in a binary format, there was a big blob of Base64 encoded data inside the printinfo.archive file.
Ok, I went one step further and used the Formula Wizard with the decodebase64( function to see what was inside this binary blob. It turns out to be more XML text. However, there was no mention of my paper tray selection in that XML. And in fact, I think this isn’t saved, because when I tried to print again, the Print dialog had no memory of my previous paper tray choice. So I think that it is not possible to save or control the tray selection at all, at least if you are using a Brother printer.
The current version of macOS has a documented API for specifying the most common print options, like page size and orientation, scale, and number of copies. In 2021 there are a lot of printers that support tray selection and two-sided printing. It would be very nice if Apple brought support for these features into the operating system itself (instead of leaving them completely up to individual printer drivers) and allowed applications to access and modify this information programmatically thru an API instead of only being accessible thru the Print dialog. However, I would not hold my breath waiting for this. My guess is that there isn’t even currently an Apple programmer with responsibility for the printing code. I don’t think there have been any changes in the printing API’s in over a decade, maybe 15 years. (In fact, I just checked, most of the printing API’s have not changed since OS X 10.0 in 2001, a couple changed in 2005 with 10.4 - ZERO changes since then. So probably no one at Apple has looked at this code in 16 years!) Apple probably thinks that printing is a dead end technology that no one uses any more.