# Can UXP open a folder via JS like CEP does?

**URL:** <https://forums.creativeclouddeveloper.com/t/can-uxp-open-a-folder-via-js-like-cep-does/7097>\
**Category:** UXP Plugin API\
**Tags:** uxp, javascript\
**Created:** [November 12, 2023, 4:24am UTC](https://forums.creativeclouddeveloper.com/t/can-uxp-open-a-folder-via-js-like-cep-does/7097 "2023-11-12T04:24:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![photonic](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/photonic/32/2513_2.png) [@photonic](https://forums.creativeclouddeveloper.com/u/photonic)\
**Post date:** [November 12, 2023, 4:24am UTC](https://forums.creativeclouddeveloper.com/t/can-uxp-open-a-folder-via-js-like-cep-does/7097/1 "2023-11-12T04:24:35Z")

</div>

With CEP I use to open a folder previously given by user so the user can access faster his exported image with the next code:

```auto
Folder(outputFolder).execute();

```

The code above opens the Window or Mac explorer on the outputFolder path.

Is there a way to do it with the a session token within UXP?

This is a great UX that I want to remain in my plugin as I’m migrating it to UXP from CEP.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![JasonM](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@JasonM](https://forums.creativeclouddeveloper.com/u/JasonM)\
**Post date:** [November 12, 2023, 6:15am UTC](https://forums.creativeclouddeveloper.com/t/can-uxp-open-a-folder-via-js-like-cep-does/7097/2 "2023-11-12T06:15:34Z")

</div>

I think it is supposed to be this:  
[https://developer.adobe.com/xd/uxp/uxp/reference-js/Modules/shell/Shell/](https://developer.adobe.com/xd/uxp/uxp/reference-js/Modules/shell/Shell/)  
But I had tried it in the past and wasn’t able to get it to work and gave up.

---

<div class="post-metadata">

**Author:** ![photonic](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/photonic/32/2513_2.png) [@photonic](https://forums.creativeclouddeveloper.com/u/photonic)\
**Post date:** [November 12, 2023, 8:36pm UTC](https://forums.creativeclouddeveloper.com/t/can-uxp-open-a-folder-via-js-like-cep-does/7097/3 "2023-11-12T20:36:06Z")

</div>

Hello Jason, this is exactly what I needed thank you very much brother! It works perfect for me and opens the folder without a problem!

Do you want to share with me what you’ve tried so I can help you to make it work and return you the favor?

Cheers!

---

<div class="post-metadata">

**Author:** ![JasonM](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@JasonM](https://forums.creativeclouddeveloper.com/u/JasonM)\
**Post date:** [November 13, 2023, 8:26am UTC](https://forums.creativeclouddeveloper.com/t/can-uxp-open-a-folder-via-js-like-cep-does/7097/4 "2023-11-13T08:26:50Z")

</div>

I don’t think I currently need that function, but if you have some working example code you could put here, that would be helpful to me or others in the future.

---

<div class="post-metadata">

**Author:** ![maxplaystudios](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@maxplaystudios](https://forums.creativeclouddeveloper.com/u/maxplaystudios)\
**Post date:** [November 17, 2023, 12:14am UTC](https://forums.creativeclouddeveloper.com/t/can-uxp-open-a-folder-via-js-like-cep-does/7097/5 "2023-11-17T00:14:44Z")

</div>

I would like that! I was able to open files but never make a folder appear in finder/explorer… I just assumed it was bugged and would get fixed later.

---

<div class="post-metadata">

**Author:** ![photonic](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/photonic/32/2513_2.png) [@photonic](https://forums.creativeclouddeveloper.com/u/photonic)\
**Post date:** [November 17, 2023, 1:25am UTC](https://forums.creativeclouddeveloper.com/t/can-uxp-open-a-folder-via-js-like-cep-does/7097/6 "2023-11-17T01:25:14Z")

</div>

I’m out of the studio for the weekend and I don’t have access to the updated code which worked for me but I’ll be back on Monday and then I can share with you the exact code I used! I just put a reminder on my calendar to write back here!

---

<div class="post-metadata">

**Author:** ![maxplaystudios](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@maxplaystudios](https://forums.creativeclouddeveloper.com/u/maxplaystudios)\
**Post date:** [November 21, 2023, 9:43pm UTC](https://forums.creativeclouddeveloper.com/t/can-uxp-open-a-folder-via-js-like-cep-does/7097/7 "2023-11-21T21:43:37Z")

</div>

I did get it working today, but thank you for checking in!

One key thing that I needed was the empty quotes “” in the “extensions” array in the manifest!  
manifest.json snippet

```auto
  "requiredPermissions": {
    "localFileSystem": "fullAccess",
    "launchProcess": {
      "schemes": [
        "http",
        "https"
      ],
      "extensions": [
        ".svg",
        ".png",
        ".psb",
        ".psd",
        ".jpeg",
        ".jpg",
        ".tif",
        ".txt",
        ".json",
        ".exe",
        ""
      ]
    },

```

main.js

```auto
const lfs = require("uxp").storage.localFileSystem;
require("uxp").shell;

token = await lfs.getFolder();
shell.openPath(token.nativePath);

```

---

<div class="post-metadata">

**Author:** ![photonic](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/photonic/32/2513_2.png) [@photonic](https://forums.creativeclouddeveloper.com/u/photonic)\
**Post date:** [November 21, 2023, 11:46pm UTC](https://forums.creativeclouddeveloper.com/t/can-uxp-open-a-folder-via-js-like-cep-does/7097/8 "2023-11-21T23:46:22Z")

</div>

Intersting! I can open it without having the extensions key with all those values on it in the mafiest! I did the same as you, I already checked my code, I used the `token.nativePath` value in the openPath() function and worked as well.

---

<div class="post-metadata">

**Author:** ![maxplaystudios](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@maxplaystudios](https://forums.creativeclouddeveloper.com/u/maxplaystudios)\
**Post date:** [November 22, 2023, 7:26pm UTC](https://forums.creativeclouddeveloper.com/t/can-uxp-open-a-folder-via-js-like-cep-does/7097/9 "2023-11-22T19:26:18Z")

</div>

I should check what happens if I just remove the extensions key entirely. Maybe it is triggering a needless “whitelist” situation.
