# executeAsModal result

**URL:** <https://forums.creativeclouddeveloper.com/t/executeasmodal-result/3868>\
**Category:** Photoshop\
**Created:** [November 10, 2021, 6:38am UTC](https://forums.creativeclouddeveloper.com/t/executeasmodal-result/3868 "2021-11-10T06:38:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matakus](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@matakus](https://forums.creativeclouddeveloper.com/u/matakus)\
**Post date:** [November 10, 2021, 6:38am UTC](https://forums.creativeclouddeveloper.com/t/executeasmodal-result/3868/1 "2021-11-10T06:38:48Z")

</div>

Apologies if this stuff is super obvious but I haven’t found any documentation that explains how to get around the newly added executeAsModal.

The code below worked as expected in API1 but after adding the await exeModal(() =\> {} around the batchplay i’m not sure how get feed the result to the if statement after

```auto
const exeModal = require('photoshop').core.executeAsModal;

   //Checks to see if the layer has a mask
   async function checkMask(layer) {

     layer = app.activeDocument.activeLayers[0].name

      await exeModal(() => {

      const result = batchPlay(
         [
            {
               "_obj": "get",
               "_target": [
                  {
                     "_property": "hasUserMask"
                  },
                  {
                     "_ref": "layer",
                     "_name": layer
                  },
               ],
            }
         ], {
      });
      console.log(result[0].hasUserMask)
   }) //<-- how to get result outside the exeModal?

      if (result[0].hasUserMask == true) {
         await deleteUserMask();
      } else {
         return
      }
}

```
