Is there a Batchplay equivalent of the ActionDescriptor fromStream method?

I have a code snippet written by r-bin that uses the Action Descriptor fromStream method to extract/convert a chunk of binary data from a local psd-file, to usable information.

With a little adjustment I created my own function to get the desired information. The function is passed a layerID integer which is used to parse and search the binary data for the right chunk of information.

var desc = new ActionDescriptor();  
desc.fromStream(buff.substr(n+16));
  
if (passedLayerID == desc.getInteger(stringIDToTypeID("layerID"))){
   // extract additional properties from desc
}else{
   // repeat fromStream with updated substring
}

I’m looking for a way to recreate this functionality with batchplay but I don’t know if a similar method exists (let alone the syntax involved in extracting the data). Any help is very much appreciated.

It does not exist yet for UXP. But you could look here: alchemist/ATNDecoder.ts at master · jardicc/alchemist · GitHub

This does decode .ATN files and those contains descriptors inside. With some adjustments you could convert binary data into compatible JS object.

Thank you for clearing that up for me.

Although it is probably way over my head, I’ll look into what you suggest is helpful to me in your dataview classes. Thanks again.