Is there a recommended way for an (UI) object to tell at instantiation time whether it's part of a saved Max 5 .maxpat file that's been opened, or a Max 4 file (be it .pat, .mxb, .mxt, or suffix-free), or if it is just being instantiated because the user has just created a new box while editing?
The reason I ask is that my object (or any UI object?) uses different saving strategies for Max 4 and Max 5. My Max 5 version obviously doesn't need to support *saving* with the Max 4 strategy, but it does need to support *reading* the Max 4 data (ie, it has to bind itself to a special symbol). And the last message sent in the stream of saved data is a special "unbind yourself from your special symbol" message, just to make sure my object doesn't find itself receiving stray messages from something else after the read is finished.
I've looked at Patcher attributes to try to distinguish between Max4 and Max5 patchers. The fileversion attribute doesn't help, because by the time my object is instantiated, the imported Max4 patcher is already identified as fileversion 1. (Which maybe makes sense…). My next attempt was with the path attribute and checking against the file suffix. It turns out this is dodgy because an imported Max4 patcher apparently isn't associated with a file (also makes sense, but doesn't help).
So, how do I tell what file format is being read from?
Also, in Max 4 we knew that if we were being instantiated from menufunc that the user had just created a brand new instance (ie no stored data coming in). So how do we find out this information on Max 5?
I've grepped through the docs, and both Googled and used the site search function with no luck. Apols in advance if this is covered somewhere.