I think I have this conversion working now… You have to use the descriptorWithDescriptorType with the offset and length and call HandleSize on the derived data.
desc is an 8 byte memory block that is returned from the low level applescript declares. MBSDesc = NSAppleEventDescriptorMBS.descriptorWithDescriptorType( thisDescType, desc.ptr(4).ptr(0), 0, HandleSize(desc.ptr(4))) where handleSize is a call to: Function HandleSize(hdl as ptr) As Integer Declare Function GetHandleSize Lib "Carbon" (h as ptr) as Integer return GetHandleSize(hdl) End Function I wonder if there is a better HandleSize I should link to now? Though all the other low level apple script declares have to be linked to carbon because as far as I know there is no Cocoa equivalent to them at all, so if you need to do anything that the higher level classes don’t do then you’re pretty much going to have to link to carbon for this stuff. It doesn’t seem to matter, this is all running in a 64bit cocoa app now and I”m still able to declare into the carbon lib without difficulty as Long as I keep in mind that an integer isn’t the same across the 2. I should change the declare above there to return a uInt32 probably… I’ll experiment with that later. > On Dec 28, 2015, at 2:25 PM, Christian Schmitz > <supp...@monkeybreadsoftware.de> wrote: > >> I’m thinking that I can probably do it at least messily for testing with the >> shared method descriptorWithDescriptorType, but while that takes a memory >> block to the data, the type is separate. I don’t know if that means that >> you’re going to do a coerce on it, or if thats actually the raw data and not >> the aedesc 8 byte type/handle object that I normally store as an aedesc? > > it's just a wrapper. > Data is copied for reference counting correctly. Thanks, James James Sentman http://www.PlanetaryGear.org http://MacHomeAutomation.com _______________________________________________ Mbsplugins_monkeybreadsoftware.info mailing list mbsplugins@monkeybreadsoftware.info https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info