# Close / hide the panel in uxp

**URL:** <https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819>\
**Category:** UXP Plugin API\
**Created:** [April 15, 2021, 3:13pm UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819 "2021-04-15T15:13:27Z")\
**Posts on this page:** 20\
**Page:** 1

<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 15, 2021, 3:13pm UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/1 "2021-04-15T15:13:27Z")

</div>

hi everyone, is there a function that closes / hides the panel in UXP?  
in cep I used this function: CSInterface.closeExtension ()

---

<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 15, 2021, 3:22pm UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/2 "2021-04-15T15:22:33Z")

</div>

Not at the moment.

We’re evaluating how much programmatic control plugins should have over the workspace given that it’s possible to interrupt the user’s workflow in painful ways. We’re not ruling anything out – but want to figure out the right path forward.

---

<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:** [April 15, 2021, 3:37pm UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/3 "2021-04-15T15:37:08Z")

</div>

In such a case plugin would get poor ratings and comments so people just would not use it anymore.

And add it as permission into permission settings if you need to.

---

<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 15, 2021, 5:40pm UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/4 "2021-04-15T17:40:39Z")

</div>

thanks to you @kerrishotts and @Jarda for your reply,surely there are many ways to disable the panel.  
I found this function very useful when checking serial numbers, when the serial was not verified I would close the panel.This is not an issue.i can find other solutions easily. I was wondering if it was still there as it was previously

---

<div class="post-metadata">

**Author:** ![IanBarber](https://avatars.discourse-cdn.com/v4/letter/i/94ad74/32.png) [@IanBarber](https://forums.creativeclouddeveloper.com/u/IanBarber)\
**Post date:** [September 9, 2021, 11:29am UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/5 "2021-09-09T11:29:52Z")

</div>

@svumme Did you find another solution when checking serial numbers, I am interested to hear if you did.

Thanks

---

<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:** [September 10, 2021, 9:41am UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/6 "2021-09-10T09:41:05Z")

</div>

@IanBarber  
even if I don’t like it as a solution, if the serial is not verified I interrupt the script.

---

<div class="post-metadata">

**Author:** ![IanBarber](https://avatars.discourse-cdn.com/v4/letter/i/94ad74/32.png) [@IanBarber](https://forums.creativeclouddeveloper.com/u/IanBarber)\
**Post date:** [September 10, 2021, 9:43am UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/7 "2021-09-10T09:43:17Z")

</div>

I tried that but it looks a bit ugly to me. Closing the panel if the serial number fails would be more elegant

---

<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:** [September 10, 2021, 9:44am UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/8 "2021-09-10T09:44:40Z")

</div>

@IanBarber I agree with you

---

<div class="post-metadata">

**Author:** ![develop13](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@develop13](https://forums.creativeclouddeveloper.com/u/develop13)\
**Post date:** [April 7, 2022, 8:45am UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/9 "2022-04-07T08:45:35Z")

</div>

Also I need a way to close or at least hide.

Or an option to invoke this “close” menu function:

 ![Screenshot 2022-04-07 at 10.41.05](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/9/9e9809c2cf58231d4580a5753a783ccc694afa09.png)

It exists now?

Thanks

---

<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 10, 2022, 6:35pm UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/10 "2022-04-10T18:35:18Z")

</div>

There is no mechanism in UXP to _close_ a plugin’s panel. (You can show panels in PS prerelease, but not hide them programmatically).

Instead of hiding, render some UI to the user that explains what the issue is, and what they can do to rectify the issue. Otherwise the user may wonder why the plugin isn’t working as expected – which can lead to increased support requirements.

---

<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:** [January 9, 2023, 10:05pm UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/11 "2023-01-09T22:05:34Z")

</div>

Any update on this? It’s really insane that we can’t control even our own panels 😕 At least it would be possible to find a command ID in the menu bar, but that’s nearly impossible, considering multi-language menus…

---

<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:** [February 9, 2023, 7:48pm UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/12 "2023-02-09T19:48:44Z")

</div>

Well you are not allowed to close your own plugin but you are allowed to reset whole workplace and that will close your plugin for sure 🤡

```auto
const {executeAsModal} = require("photoshop").core;
const {batchPlay} = require("photoshop").action;

async function actionCommands() {
   const result = await batchPlay(
      [
         {
            _obj: "reset",
            _target: [
               {
                  _ref: "workspace",
                  _name: "Essentials"
               }
            ],
            _options: {
               dialogOptions: "dontDisplay"
            }
         }
      ],
      {
      }
   );
}

async function runModalFunction() {
   await executeAsModal(actionCommands, {"commandName": "Action Commands"});
}

await runModalFunction();

```

---

<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 9, 2023, 7:51pm UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/13 "2023-02-09T19:51:32Z")

</div>

I guess not just your plugin 😃

---

<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:** [February 9, 2023, 7:55pm UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/14 "2023-02-09T19:55:33Z")

</div>

Common… you spoiled the plot twist! 😅

---

<div class="post-metadata">

**Author:** ![BJell](https://avatars.discourse-cdn.com/v4/letter/b/f9ae1b/32.png) [@BJell](https://forums.creativeclouddeveloper.com/u/BJell)\
**Post date:** [March 24, 2023, 6:21am UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/15 "2023-03-24T06:21:40Z")

</div>

I understand reluctance on control over closing panels while running, but on installation it would be great to have a flag in the manifest to set the initial state to visible or hidden. Showing all the panels after install is confusing for the user and just ugly.

At least I figured out that calling showPanel brings that panel to the front, so I use that to get the main panel at the front of the stack at least (the default order seems random?).

---

<div class="post-metadata">

**Author:** ![kritskiy](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@kritskiy](https://forums.creativeclouddeveloper.com/u/kritskiy)\
**Post date:** [December 30, 2023, 8:41pm UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/16 "2023-12-30T20:41:27Z")

</div>

Hello,  
I was wondering if there are any updates on this. I really liked the option to close the panel from CEP: a usecase for me was a hotkey-callable panel with some functions on it that would auto-close on running the functions: to not clutter PS UI with it.

---

<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:** [December 30, 2023, 10:19pm UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/17 "2023-12-30T22:19:28Z")

</div>

You can run some menu items to toggle panel visibility. You can use Photoshop API to your own plugins by ID… but that is about it.

I am not sure what Adobe is afraid of. If changing panels visibility sounds scary… why not add new permission into a manifest file?

---

<div class="post-metadata">

**Author:** ![kritskiy](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@kritskiy](https://forums.creativeclouddeveloper.com/u/kritskiy)\
**Post date:** [December 31, 2023, 10:06am UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/18 "2023-12-31T10:06:39Z")

</div>

oh of course, I should try the menu items toggling — I’ve used a similar thing with AM. Thanks Jarda!

---

<div class="post-metadata">

**Author:** ![kritskiy](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@kritskiy](https://forums.creativeclouddeveloper.com/u/kritskiy)\
**Post date:** [December 31, 2023, 10:25am UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/19 "2023-12-31T10:25:31Z")

</div>

Hm, however some tests proved that it could more complicated than I thought.  
“Insert menu item” in the Actions panel doesn’t add any steps when I try to insert the UXP panel.  
The Alchemist also doesn’t seem to catch the event of toggling the panel on/off…  
I tried to put the name of my panel into the code I got from toggling visibility of a CEP panel but this didn’t work.

This is the code I was using:

```auto
    async function actionCommands() {
        const result = await require("photoshop").action.batchPlay([{"_obj":"select","_target":[{"_name":"UXP Test Panel","_ref":"menuItemClass"}]}], {});
    }
    
    async function runModalFunction() {
        await require("photoshop").core.executeAsModal(actionCommands, {"commandName": "Action Commands"});
    }
    
    await runModalFunction();

```

if I log the `result` I’m getting the error:  
`"My UXP Playground: The object “menu item “UXP Test Panel”” is not currently available."`

Am I missing something?

---

<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:** [December 31, 2023, 10:30am UTC](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819/20 "2023-12-31T10:30:32Z")

</div>

You are not missing anything. This works only for built-in menu items and panels.

For non-built-in menu items you could try command ID but this one will be dynamic and change after every PS restart.

[Next page](https://forums.creativeclouddeveloper.com/t/close-hide-the-panel-in-uxp/2819.md?page=2)
