Skip to main content
Inspiring
January 31, 2024
Question

Windows file dialog - show files

  • January 31, 2024
  • 1 reply
  • 159 views

I can create a Windows dialog box to select a folder (to process .png images) with this

 

 

var filterFiles = "PNG:*.png"; // I am windows
var inFolder = Folder.selectDialog("Please select FOLDER to process", filterFiles);
if (inFolder != null)
{
  var fileList = inFolder.getFiles(/\.(png)$/i);
}

 

But... how do I get the script to show the dialog that shows all files in it. Like this:

 

 

 

 

This topic has been closed for replies.

1 reply

Legend
January 31, 2024

You can't on Windows. Using the folder select dialog doesn't show files (it does on Mac.)

var a = new File('~/Desktop').openDlg('Select', '*.png');
var b = a.parent;
var c = b.getFiles('*.png');

 

var a = Folder.selectDialog();
var c = a.getFiles('*.png')