# Changing Magic Wand tool options with code

**URL:** <https://forums.creativeclouddeveloper.com/t/changing-magic-wand-tool-options-with-code/10894>\
**Category:** UXP Plugin API\
**Created:** [May 17, 2025, 9:20am UTC](https://forums.creativeclouddeveloper.com/t/changing-magic-wand-tool-options-with-code/10894 "2025-05-17T09:20:57Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [May 18, 2025, 2:24pm UTC](https://forums.creativeclouddeveloper.com/t/changing-magic-wand-tool-options-with-code/10894/3 "2025-05-18T14:24:37Z")

</div>

How did you try to change these options?

Check this example as a guideline (it’s for paint brush):

> [@Setting minimum brush opacity](https://forums.creativeclouddeveloper.com/t/setting-minimum-brush-opacity/3104/35):
>
> Here the complete code: const batchPlay = require("photoshop").action.batchPlay; // GET TOOL OPTIONS async function getCurrentToolOptions () { const app = require('photoshop').app; const result = await batchPlay( [{ "\_obj": "get", "\_target": [{ "\_property": "currentToolOptions" }, { "\_ref": "application", "\_enum": "ordinal", "\_value": "targetEnum" }], …

And here’s for clone stamp:

> [@Setting minimum brush opacity](https://forums.creativeclouddeveloper.com/t/setting-minimum-brush-opacity/3104/37):
>
> await require("photoshop").core.executeAsModal(currentlayer); async function setclonestampToolOptions(currenttooloptions) { const app = require('photoshop').app; const result = await batchPlay( [{ "\_obj": "set", "\_target": [{ "\_ref": "cloneStampTool" }], "to": currenttooloptions } ],{ "synchronousExecution": false }); } async function currentlayer() { let cto = await getCurrentToolOptions(); cto.$…

Should be pretty much the same logic for magic wand too

---

_[View the full topic](https://forums.creativeclouddeveloper.com/t/changing-magic-wand-tool-options-with-code/10894)._
