Skip to main content
Inspiring
December 24, 2012
Answered

Restrict open dialog to choose folders (instead of files)

  • December 24, 2012
  • 1 reply
  • 1841 views

Hi friends

I´ve searched in the Photoshop reference but did not find what I need. So I´m asking your help (again)

I´d like to let the user choose a folder that, in a moment inside the script, will be used to open their files.

if I use >>>> var pasta = new Folder (app.openDialog())

This open the dialog to choose files...not folders.

Is there any method to use the Photoshop Open dialog box...but restrict to choose only Folders???

If having subfolder...include the content of subfolder...(in the next step I´ll use the pasta.getFiles to get an array of the files).

Thank you for the help

Gustavo.

This topic has been closed for replies.
Correct answer Paul Riggott

This should work for you....

var inputFolder = Folder.selectDialog("Please select the folder with Files to process");

1 reply

Paul Riggott
Paul RiggottCorrect answer
Inspiring
December 24, 2012

This should work for you....

var inputFolder = Folder.selectDialog("Please select the folder with Files to process");

Inspiring
December 24, 2012

Hi Paul

Thank you a lot for the tip.

Just one more question...when calling:

var arquivos = inputFolder.getFiles ("*.psd", "*.jpg", "*.tiff", "*.bmp", "*.ai", "*.gif", "*.png")

how could I tell Photoshop to include all itens in subfolders?

Thank you a lot

Gustavo.