File dialogs broken?

I tried to open a file dialog within a UXP Photoshop plugin - using mainfest version 5.

The code, which worked in manifest vs. 4 does not work in vs 5.

const fs=require(‘uxp’).storage.localFileSystem;
const result=await fs.getFileForSaving({types:[“json”]});

... no file dialog is showng up.

My manifest.json contains the following permission requirements:

"requiredPermissions": { "allowCodeGenerationFromStrings": true, "launchProcess": { "schemes": [ "http", "https", "mailto" ], "extensions": [ ".svg", ".png" ], "localFileSystem" : "request" }

Am I missing something?

you need to provide a suggestedName before the options object.
although docs say:

suggestedName : String : Required when options.types is not defined.

yet I found that omitting it resulted in an error .


const result = await fs.getFileForSaving("myFile.json", {types:["json"]});
const result = await fs.getFileForSaving("", {types:["json"]});

Thanks for the answer, but I am afraid that it did not help. Even if the first parameter (suggestedFileName) is provided, the file dialog is not opened.
Curiously enough, the same code works fine if manifest version 4 is used (and the “requiredPermission” section is removed from the manifest.
My guess is, that probably some permission is missing in manfest V.5., but which one???

I think your requiredPermissions is not valid, it looks like you have localFileSystem inside the launchProcess object.

try the following please:

"requiredPermissions": {
    "allowCodeGenerationFromStrings": true,
    "launchProcess": {
        "schemes": ["http","https","mailto"],
        "extensions": [".svg",".png"]
    "localFileSystem": "request"

YOU SAVED MY DAY!!! Thanks! Now it’s working.

you’re more than welcome, glad things worked out!

kindly mark the reply as a solution for ease of browsing for other members.
also I almost missed the issue due to bad code formatting, in the future formatting your code will make it more likely for people to be able to help.

best of luck with your projects :slight_smile:

1 Like