Search code examples
photoshopextendscript

selectDialog with address bar instead of dropdown with Photoshop script


I'm writing a custom script for Photoshop to handle batch processing of images. I have two input folders and an output folder that I need to specify. Right now I'm using something like this to select my folders:

var inputFolder = Folder.selectDialog("Select a folder of  images to process");

Because I'm working on a server with a pretty deep folder hierarchy, it can be a real pain to select through the drop-down menu that Photoshop presents to me in this dialog.

My target folder is actually much deeper than this...

It would be so much easier to have a folder selection dialog with an address bar and quick access panel like this:

So much easier to navigate!

All other PS scripts that I've been digging around in use the Folder.selectDialog method to set file paths to a variable. Is there a reason for this? If not, then how can I instruct Photoshop the second style of folder navigation dialog?


Solution

  • It doesn't appear that Adobe supports this dialog as a folder selecting option.

    There was a similar thread to this posted on the Adobe forums where a workaround was suggested:

    https://forums.adobe.com/thread/1094128

    The solution that was suggested is to use a saveDialog function instead of selectFolder. This gives you the folder dialog that we want, but comes with the downside of having to type a dummy name into the filename path. It also says "Save As" on the top of the dialog box, which is confusing.

    Here's what was offered:

    by lilsmokie on Nov 8, 2012 2:19 PM

     var dskTop = Folder.desktop;
        var dskPth = String(dskTop);
        var newSpot = new File(dskPth+"/poop");
        var selectedFolder = newSpot.saveDlg('Select Destination Folder');
        var illFilePath = selectedFolder.path;
        alert(illFilePath); 
    

    This opens the dialog at the desktop. Then put "poop" or whatever you like in the text field. There the user can navigate to where ever. When they it save illFilePath will have the folder path. Not perfect but its close enough for me right now.

    I've also discovered that I can set the starting location of the selectDialog by using selectDlg instead:

    var outputFolder = Folder(app.activeDocument.path).selectDlg("Select a folder to output images to:");
    

    This gives some control over the starting location so that the user doesn't have to click through a million dropdowns.