# How to convert a layer to a smart object

**URL:** <https://forums.creativeclouddeveloper.com/t/how-to-convert-a-layer-to-a-smart-object/2787>\
**Category:** UXP Plugin API\
**Created:** [April 12, 2021, 1:29am UTC](https://forums.creativeclouddeveloper.com/t/how-to-convert-a-layer-to-a-smart-object/2787 "2021-04-12T01:29:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luke](https://avatars.discourse-cdn.com/v4/letter/l/7ab992/32.png) [@luke](https://forums.creativeclouddeveloper.com/u/luke)\
**Post date:** [April 12, 2021, 1:29am UTC](https://forums.creativeclouddeveloper.com/t/how-to-convert-a-layer-to-a-smart-object/2787/1 "2021-04-12T01:29:24Z")

</div>

Is there a way to convert a layer to a smart object?  
batchplay or photoshop other apis

---

<div class="post-metadata">

**Author:** ![tomzag](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/tomzag/32/2464_2.png) [@tomzag](https://forums.creativeclouddeveloper.com/u/tomzag)\
**Post date:** [April 12, 2021, 1:38pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-convert-a-layer-to-a-smart-object/2787/2 "2021-04-12T13:38:36Z")

</div>

Hi,

this should work (got it with [Alchemist](https://adobe.com/go/cc_plugins_discover_plugin?pluginId=2bcdb900&workflow=share)):

```
const batchPlay = require("photoshop").action.batchPlay;
const result = batchPlay(
[
   {
      "_obj": "newPlacedLayer",
      "_isCommand": true,
      "_options": {
         "dialogOptions": "dontDisplay"
      }
   }
],{});
```

---

<div class="post-metadata">

**Author:** ![Pierre\_G](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pierre_g/32/971_2.png) [@Pierre\_G](https://forums.creativeclouddeveloper.com/u/Pierre_G)\
**Post date:** [April 12, 2021, 1:59pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-convert-a-layer-to-a-smart-object/2787/3 "2021-04-12T13:59:35Z")

</div>

Or just

```
const batchPlay = require("photoshop").action.batchPlay;
await batchPlay(
    [{
        "_obj": "newPlacedLayer",
    }], {});
```

---

<div class="post-metadata">

**Author:** ![luke](https://avatars.discourse-cdn.com/v4/letter/l/7ab992/32.png) [@luke](https://forums.creativeclouddeveloper.com/u/luke)\
**Post date:** [April 13, 2021, 3:16am UTC](https://forums.creativeclouddeveloper.com/t/how-to-convert-a-layer-to-a-smart-object/2787/4 "2021-04-13T03:16:27Z")

</div>

Thanks tomzag and Pierre.
