# executeAsModal doesn't work

**URL:** <https://forums.creativeclouddeveloper.com/t/executeasmodal-doesnt-work/6852>\
**Category:** UXP Plugin API\
**Tags:** uxp, javascript\
**Created:** [September 20, 2023, 3:44pm UTC](https://forums.creativeclouddeveloper.com/t/executeasmodal-doesnt-work/6852 "2023-09-20T15:44:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Maher](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/maher/32/1432_2.png) [@Maher](https://forums.creativeclouddeveloper.com/u/Maher)\
**Post date:** [September 20, 2023, 6:11pm UTC](https://forums.creativeclouddeveloper.com/t/executeasmodal-doesnt-work/6852/3 "2023-09-20T18:11:15Z")

</div>

see this please

> [@How can I pass a custom parameter to BatchPlay?](http://forums.creativeclouddeveloper.com/t/how-can-i-pass-a-custom-parameter-to-batchplay/6249/8):
>
> it took me time to wrap my head around but I managed to use it successfully I think it produces cleaner code. you basically define a property in options called descriptor it could be an object/array/string/boolean/integer… executeAsModal(targetFunction, {"commandName": "Disable Snap to Pixels", "descriptor": "any value, any type"});` function targetFunction(execContext, myString){ //myString (2nd parameter) always holds the descriptor. console.log(myString); // output: "any value…

---

_[View the full topic](https://forums.creativeclouddeveloper.com/t/executeasmodal-doesnt-work/6852)._
