# Photoshop uxp layer translate

**URL:** <https://forums.creativeclouddeveloper.com/t/photoshop-uxp-layer-translate/11369>\
**Category:** UXP Plugin API\
**Tags:** bug, uxp\
**Created:** [August 28, 2025, 3:13pm UTC](https://forums.creativeclouddeveloper.com/t/photoshop-uxp-layer-translate/11369 "2025-08-28T15:13:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xue](https://avatars.discourse-cdn.com/v4/letter/x/8797f3/32.png) [@xue](https://forums.creativeclouddeveloper.com/u/xue)\
**Post date:** [August 28, 2025, 3:13pm UTC](https://forums.creativeclouddeveloper.com/t/photoshop-uxp-layer-translate/11369/1 "2025-08-28T15:13:10Z")

</div>

Why can only selected layers be moved in Photoshop UXP.  
const app = require(‘photoshop’).app;  
const doc = app.activeDocument;  
let lays= Array.from(doc.layers);  
await lays[2].translate(0,110);  
await lays[3].translate(0,220);  
await lays[4].translate(100,330);  
If a layer is not selected, this movement is invalid. If a layer is selected, all movement methods will apply to the selected layer.  
How to write another operation using action descriptors,  
Is the code below invalid?

const { batchPlay } = require(“photoshop”).action;  
const { executeAsModal } = require(“photoshop”).core;  
const command1 =[{  
“\_obj”: “move”,  
“\_target”: [{

“\_ref”: “layer”  
}],  
“layerID”: 98,  
“to”: {  
“\_obj”: “offset”,  
“horizontal”: {  
“\_unit”: “pixelsUnit”,  
“\_value”: -105  
},  
“vertical”: {  
“\_unit”: “pixelsUnit”,  
“\_value”: 0  
}  
}  
}]  
await executeAsModal(() =\> {  
batchPlay(command, {});

}, {  
commandName: “moveLay”  
});

---

<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:** [August 28, 2025, 5:41pm UTC](https://forums.creativeclouddeveloper.com/t/photoshop-uxp-layer-translate/11369/2 "2025-08-28T17:41:07Z")

</div>

Because it is about 20 years old code, and it is at the very bottom of their priorities to change it.

These days, devs are mostly working on AI and Express. But it would be very cool to simplify referencing the layers.
