How to retrieve a rectangle from an AppleEvent?

Thanks! At first, I thought it was a good news, but… Xojo crashes.

Here’s the code I tried:

Var ae As new AppleEvent("core","getd",BundleID)
ae.ObjectSpecifierParam("----")=GetPropertyObjectDescriptor(TheWindow,"pbnd") //TheWindow is a valid AppleEventObjectSpecifier

call ae.Send
Var d As AppleEventDescList=ae.ReplyDescList
Var d2 As AppleEventDescList=d.DescListItem(1)
Var i As Integer=d2.IntegerItem(1)

When I step thru this code, after the assignment of d2, the debugger reports incorrectly that d2 is an AppleEventRecord object (so, accessing its IntegerItem crashes the app, since it’s the wrong object type).
This is certainly the same issue I reported some days ago: How to convert an AppleEventRecord to an AppleEventObjectSpecifier when the framework mangles them? - #11 by Arnaud_N

This auto-conversion to AppleEventRecord in various places of the framework really sucks…

May I ask you if you can try on your side, if you get the same crash?

In my early days of RealBasic, I already played with AppleEvents. I experimented like you suggests. Trials and errors, for possibly months.
Opacity in the debugger and types changing-bugs (AppleEventRecord), along with rare successful attempts in some cases eventually led me to lose patience in this area. Since nothing has evolved in Xojo regarding AppleEvents, I’m not sure I want to revive this bad experience, hence the reason I asked in the forum (but I tried a bit, anyway).