# Is there a Batchplay equivalent of the ActionDescriptor fromStream method?

**URL:** <https://forums.creativeclouddeveloper.com/t/is-there-a-batchplay-equivalent-of-the-actiondescriptor-fromstream-method/6175>\
**Category:** Photoshop\
**Tags:** batch-play\
**Created:** [April 12, 2023, 8:04pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-batchplay-equivalent-of-the-actiondescriptor-fromstream-method/6175 "2023-04-12T20:04:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PatrickDeen](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/patrickdeen/32/1263_2.png) [@PatrickDeen](https://forums.creativeclouddeveloper.com/u/PatrickDeen)\
**Post date:** [April 12, 2023, 8:04pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-batchplay-equivalent-of-the-actiondescriptor-fromstream-method/6175/1 "2023-04-12T20:04:07Z")

</div>

I have a [code snippet written by r-bin](https://community.adobe.com/t5/photoshop-ecosystem-discussions/is-there-any-way-to-move-the-time-indicator-of-timeline-to-first-frame-of-the-layer-using-photoshop/td-p/9945227) 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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![Jarda](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jarda/32/1909_2.png) [@Jarda](https://forums.creativeclouddeveloper.com/u/Jarda)\
**Post date:** [April 15, 2023, 9:22am UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-batchplay-equivalent-of-the-actiondescriptor-fromstream-method/6175/2 "2023-04-15T09:22:23Z")

</div>

It does not exist yet for UXP. But you could look here: [alchemist/ATNDecoder.ts at master · jardicc/alchemist · GitHub](https://github.com/jardicc/alchemist/blob/master/src/atnDecoder/classes/ATNDecoder.ts#L141)

> <https://github.com/jardicc/alchemist/blob/master/src/atnDecoder/classes/DataViewCustom.ts>

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

---

<div class="post-metadata">

**Author:** ![PatrickDeen](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/patrickdeen/32/1263_2.png) [@PatrickDeen](https://forums.creativeclouddeveloper.com/u/PatrickDeen)\
**Post date:** [April 15, 2023, 10:34am UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-batchplay-equivalent-of-the-actiondescriptor-fromstream-method/6175/3 "2023-04-15T10:34:58Z")

</div>

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.
