# executeAsModal with argument

**URL:** <https://forums.creativeclouddeveloper.com/t/executeasmodal-with-argument/7466>\
**Category:** UXP Plugin API\
**Created:** [February 1, 2024, 5:20pm UTC](https://forums.creativeclouddeveloper.com/t/executeasmodal-with-argument/7466 "2024-02-01T17:20:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [February 2, 2024, 6:42am UTC](https://forums.creativeclouddeveloper.com/t/executeasmodal-with-argument/7466/4 "2024-02-02T06:42:56Z")

</div>

See this post:

> [@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-with-argument/7466)._
