# Returning all selected layer id’s with batchPlay in UXP for Photoshop

**URL:** <https://forums.creativeclouddeveloper.com/t/returning-all-selected-layer-id-s-with-batchplay-in-uxp-for-photoshop/7868>\
**Category:** UXP Plugin API\
**Tags:** uxp, javascript\
**Created:** [May 8, 2024, 9:12pm UTC](https://forums.creativeclouddeveloper.com/t/returning-all-selected-layer-id-s-with-batchplay-in-uxp-for-photoshop/7868 "2024-05-08T21:12:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rip](https://avatars.discourse-cdn.com/v4/letter/r/e99b99/32.png) [@Rip](https://forums.creativeclouddeveloper.com/u/Rip)\
**Post date:** [May 8, 2024, 9:12pm UTC](https://forums.creativeclouddeveloper.com/t/returning-all-selected-layer-id-s-with-batchplay-in-uxp-for-photoshop/7868/1 "2024-05-08T21:12:43Z")

</div>

What’s the correct way to return all of the selected layer id’s with batchPlay?

Also, does any batchPlay layer property indicate whether or not a layer is selected?

This code will return some key identifiers for all layers:

> async function test\_modal\_function(){
> 
> layerProperties =
> 
> { \_obj: “multiGet”,
> 
> ```
> _target: {_ref: [{_ref: "document", _enum: "ordinal"}]},
> 
> extendedReference: [["name", "layerID", "parentLayerID", "itemIndex", "group", "layerKind"], {_obj: "layer", index:1, count:-1}],
> options: {failOnMissingProperty:false, failOnMissingElement: false}
> 
> ```
> 
> };
> 
> result = await require(“photoshop”).action.batchPlay([layerProperties], {});  
> console.log(result)  
> }

Is there a syntax for the target term: {\_obj: “layer”, index:1, count:-1}, that will return these data for all selected layers?

Alternatively, is there a layer property that can be returned that indicates whether or not that layer is selected?
