# Questions about api2

**URL:** <https://forums.creativeclouddeveloper.com/t/questions-about-api2/3761>\
**Category:** Photoshop\
**Created:** [October 20, 2021, 7:41am UTC](https://forums.creativeclouddeveloper.com/t/questions-about-api2/3761 "2021-10-20T07:41:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrL](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@MrL](https://forums.creativeclouddeveloper.com/u/MrL)\
**Post date:** [October 20, 2021, 7:41am UTC](https://forums.creativeclouddeveloper.com/t/questions-about-api2/3761/1 "2021-10-20T07:41:26Z")

</div>

Because of my work, I haven’t paid attention to uxp for several months. Recently, I found that uxp has api2 version, and some contents of API1 are deleted. I want to know where I can learn the details of api2?

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [October 20, 2021, 8:06am UTC](https://forums.creativeclouddeveloper.com/t/questions-about-api2/3761/2 "2021-10-20T08:06:22Z")

</div>

You’re not the only one having this question. I’m also following this topic:  
[http://forums.creativeclouddeveloper.com/t/converting-uxp-plugin-to-api-2/3719/4](http://forums.creativeclouddeveloper.com/t/converting-uxp-plugin-to-api-2/3719/4)

---

<div class="post-metadata">

**Author:** ![MrL](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@MrL](https://forums.creativeclouddeveloper.com/u/MrL)\
**Post date:** [October 20, 2021, 2:01pm UTC](https://forums.creativeclouddeveloper.com/t/questions-about-api2/3761/3 "2021-10-20T14:01:33Z")

</div>

Yes, I just want to know what functions api2 has deleted, but I haven’t found the relevant information. Now I have suspended the development of my new plug-in.

---

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [October 20, 2021, 6:25pm UTC](https://forums.creativeclouddeveloper.com/t/questions-about-api2/3761/4 "2021-10-20T18:25:54Z")

</div>

I think this page has the documention that you need but it is giving a 404 error right now. The Adobe “stage” documents have lots of intermittent 404 error issues.

[https://developer-stage.adobe.com/photoshop/uxp/2022/ps\_reference/media/executeasmodal/](https://developer-stage.adobe.com/photoshop/uxp/2022/ps_reference/media/executeasmodal/)

The main thing with API 2 is running the execute as modal. See this post here.

> [@How To Get BatchPlay To Work With API 2](http://forums.creativeclouddeveloper.com/t/how-to-get-batchplay-to-work-with-api-2/3760/28):
>
> That doesn’t tell us anything about whether or not modeless Photoshop dialog interaction will be supported in API 2. That is a huge deal for some plugins if that functionality gets dropped. I really wish we had some clarification on this.

Also, if you want to see a basic working example of using executeAsModal in API 2 then download this sample plugin. Just change the .ccx to .zip and you can view the files. I made this for a bug report to give to Adobe for a text resizing bug. However, the executeAsModal part works as it should.

[https://damonbell.com/downloads/text-resize-bug\_PS.ccx](https://damonbell.com/downloads/text-resize-bug_PS.ccx)

---

<div class="post-metadata">

**Author:** ![NaokiHada\_Logitech](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/naokihada_logitech/32/1543_2.png) [@NaokiHada\_Logitech](https://forums.creativeclouddeveloper.com/u/NaokiHada_Logitech)\
**Post date:** [December 15, 2021, 12:06am UTC](https://forums.creativeclouddeveloper.com/t/questions-about-api2/3761/5 "2021-12-15T00:06:31Z")

</div>

@ddbell  
Thank you very much for sharing the sample. It is very helpful.  
I verified my code is working with executeAsModal.

So it looks like following for batchPlay() part.

API 1:  
async function test(){  
await require(‘photoshop’).action.batchPlay([  
{…JSON…}  
], {})  
}

API 2:  
async function test(){  
await require(‘photoshop’).core.executeAsModal(async function(){  
await require(‘photoshop’).action.batchPlay([  
{…JSON…}  
], {})  
});  
}
