# How to call HDR command？

**URL:** <https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606>\
**Category:** Photoshop\
**Tags:** bug, javascript\
**Created:** [March 2, 2021, 10:18am UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606 "2021-03-02T10:18:31Z")\
**Posts on this page:** 13\
**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:** [March 2, 2021, 10:18am UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/1 "2021-03-02T10:18:31Z")

</div>

This is the code I’m listening to, but it doesn’t work.

```
require("photoshop").action.batchPlay([
   {
      "_obj": "AdobeScriptAutomation Scripts",
      "javaScript": {
         "_path": "C:\\Program Files\\Adobe\\Adobe Photoshop 2021\\Required\\HDRToning.jsx",
         "_kind": "local"
      },
      "javaScriptMessage": "undefined",
      "_isCommand": true,
      "_options": {
         "dialogOptions": "display"
      }
   }
],{"synchronousExecution": false,"modalBehavior": "fail"});
```

---

<div class="post-metadata">

**Author:** ![Jarda](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jarda/32/1909_2.png) [@Jarda](https://forums.creativeclouddeveloper.com/u/Jarda)\
**Post date:** [March 2, 2021, 11:22am UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/2 "2021-03-02T11:22:56Z")

</div>

You have to use a token instead of path.

---

<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:** [March 2, 2021, 11:26am UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/3 "2021-03-02T11:26:05Z")

</div>

Hello, how to use the token

---

<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:** [March 3, 2021, 7:27am UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/5 "2021-03-03T07:27:02Z")

</div>

It’s finally working！

```
var tempFun = async function () {

    const PluginFolder = await FS.getPluginFolder();

    const theTemplate = await PluginFolder.getEntry("HDRToning.jsx");

    const Token=await FS.createSessionToken(theTemplate);

    await PS.action.batchPlay([{

        "_obj": "AdobeScriptAutomation Scripts",

        "javaScript": {

            "_path": Token,

            "_kind": "local"

        },

        "javaScriptMessage": "undefined",

        "_isCommand": true

    }], {});

}

tempFun();
```

---

<div class="post-metadata">

**Author:** ![kerrishotts](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kerrishotts/32/8_2.png) [@kerrishotts](https://forums.creativeclouddeveloper.com/u/kerrishotts)\
**Post date:** [March 6, 2021, 12:07am UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/6 "2021-03-06T00:07:15Z")

</div>

Hey there – I’m glad you found a solution. Note, however, that this is not going to work long-term, as ExtendScript is not technically supported by UXP. As such, it’s likely that the mechanism you’re using here will stop working. Furthermore, it requires redistributing part of Photoshop (HDRToning.jsx) alongside your plugin, which is also not something you should do.

(In general: if you need to execute ExtendScript, the correct way to do that in UXP is to convert that ExtendScript to modern JavaScript. Adobe does not support interfacing with ExtendScript from UXP.)

I’m sure there’s a `batchPlay` command to do this equivalent, however, this works just as well:

```auto
const core=require("photoshop").core;
core.performMenuCommand({
    title: core.translateUIString("$$$/Menu/Adjust/HDRToning")
});

```

If this doesn’t fully meet your needs, please describe in more detail how you’re using the HDR Toning feature, and we can help further.

---

<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:** [March 6, 2021, 3:30am UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/7 "2021-03-06T03:30:40Z")

</div>

Thank you very much, this is exactly the code I want

---

<div class="post-metadata">

**Author:** ![svumme](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/svumme/32/1289_2.png) [@svumme](https://forums.creativeclouddeveloper.com/u/svumme)\
**Post date:** [April 26, 2021, 4:00pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/8 "2021-04-26T16:00:01Z")

</div>

@kerrishotts Do you know where I can find a list for all functioning “zstring”?

---

<div class="post-metadata">

**Author:** ![AnthonyK](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AnthonyK](https://forums.creativeclouddeveloper.com/u/AnthonyK)\
**Post date:** [April 26, 2021, 11:19pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/9 "2021-04-26T23:19:40Z")

</div>

Or a list of commandID’s, as it seems these can be used too.

---

<div class="post-metadata">

**Author:** ![Pierre\_G](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pierre_g/32/971_2.png) [@Pierre\_G](https://forums.creativeclouddeveloper.com/u/Pierre_G)\
**Post date:** [April 27, 2021, 1:01am UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/10 "2021-04-27T01:01:36Z")

</div>

Here, you can have mine: [ZStrings](https://github.com/pierreGuidera/ZString_PS2021/blob/main/zstring.txt)

---

<div class="post-metadata">

**Author:** ![svumme](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/svumme/32/1289_2.png) [@svumme](https://forums.creativeclouddeveloper.com/u/svumme)\
**Post date:** [April 27, 2021, 7:48am UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/11 "2021-04-27T07:48:30Z")

</div>

> [@kerrishotts](#):
>
> `$$/Menu/Adjust/HDRToning`

Thanks @Pierre_G you are always kind. @DavideBarranca gave me the list of zstrings (I think it is the same list), unfortunately I have seen that many zstrings do not work. I was wondering if there was a list of zstrings that work.

---

<div class="post-metadata">

**Author:** ![Pierre\_G](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pierre_g/32/971_2.png) [@Pierre\_G](https://forums.creativeclouddeveloper.com/u/Pierre_G)\
**Post date:** [April 27, 2021, 9:16am UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/12 "2021-04-27T09:16:56Z")

</div>

You’re welcome! I have extracted these zstrings from PS2021, so I believe they are valid. How to use them is another kettle of fish 😅

---

<div class="post-metadata">

**Author:** ![kerrishotts](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kerrishotts/32/8_2.png) [@kerrishotts](https://forums.creativeclouddeveloper.com/u/kerrishotts)\
**Post date:** [April 27, 2021, 3:52pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/13 "2021-04-27T15:52:14Z")

</div>

There’s no “list” other than extracting them from the app itself.

So far, the only ZStrings I’ve seen work in this case are those that are added dynamically (and talk to JSX scripts). Otherwise you have to use commands, but I’m not aware of any authoritative list of those.

---

<div class="post-metadata">

**Author:** ![naokihada](https://avatars.discourse-cdn.com/v4/letter/n/b9e5f3/32.png) [@naokihada](https://forums.creativeclouddeveloper.com/u/naokihada)\
**Post date:** [January 27, 2023, 7:27pm UTC](https://forums.creativeclouddeveloper.com/t/how-to-call-hdr-command/2606/14 "2023-01-27T19:27:35Z")

</div>

Thank you Kerri,  
This is very helpful.  
-Naoki
