Method for opening multiple files

Maybe i’m blind, but even after extensive search of the docs and the forum, i only see methods for opening single files.
I just want to batch process multiple raw images files and need a dialog with a filter for file extensions. Then i would like the user to pick multiple files for processing in Photoshop…iterate over the file list etc… Just like the old File.openDialog in Extendscript. Something like getFilesforOpening (plural).
Any hints or ugly snuggly workarounds?

See https://www.adobe.io/photoshop/uxp/uxp/reference-js/Modules/uxp/Persistent%20File%20Storage/FileSystemProvider/#getfileforopeningoptions

— there’s a allowMultiple option that you can pass that enables you to get a list of all selected files as an array.

1 Like

Thank you so much @kerrishotts for clarifying (that i’m really blind ;-))

Maybe a bug? The option types: fileTypes.images does not work and will cause the dialog to not open.

Have you imported fileTypes from the storage module? They aren’t defined globally; they’ll need to be required from the storage module.

const { fileTypes } = require("uxp").storage;

Then see if it works.

1 Like

Aaah! Thanks Kerri. Now i’ve got it!