And you get something similar for AppleScript if you run it outside a script editor. When you do it in a script editor, the editor loads the app’s dictionary and translates between terminology and underlying codes – outside a script editor, that doesn’t happen. (Yes, Xcode is a script editor of sorts, but the console is not a script log.)
That’s actually what I was using as a workaround before.
I figured it was a better approach to coerce the actual data returned from Mail.app instead of relaying on my own interpretation of it in an if statement. If something changes in Mail.app’s code in the future, the coercing is more likely going to stand, while my own interpretation of the returned data is probably going to fail without an update of my app.
Anyway, I’m going to look into it. Thanks for the valuable info and insights!