Copy link to clipboard
Copied
Folder.selectDialog('Select the folder to be imported');
So this is what I use when I need a user to select a folder. The code always works really well but I kinda hate the actual dialog. I wish I could select folders with the Save As Dialog.
It has more options, I can use shortcuts, it saves your place.
Does anyone know how I can set up a folder select dialog that functions similar to the save as dialog?
Any knowledge would be helpful.
Thanks for looking.
So this is what I got.
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
...Copy link to clipboard
Copied
You can try openDlg() from page 53 of the Tools Guide. It might open a different dialog.
Maybe this thread helps as well: http://forums.adobe.com/message/4272088#4272088
Copy link to clipboard
Copied
Thank You!
Very helpfull direction. I am checking this out now.
Copy link to clipboard
Copied
Did it actually open a different dialog?
Copy link to clipboard
Copied
It did. I actually am using saveDlg();
Which is very similar.
I am still figuring this out.
openDlg(); wants you to select a file.
saveDlg(); wants to save a file to a location.
I want to select a folder.
Apparently as long as I have text in the text field this will work. So I am figuring out how to make sure the Dialog has some default text. But if the user selects a file the text field will change, which isn't the best. I wish there were a way to lock the text down in the text field.
Maybe this doesn't matter. If I can figure out how to remove the file name from the path this will be fine. I haven't had a chance to figure that one out.
Copy link to clipboard
Copied
So this is what I got.
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.
Copy link to clipboard
Copied
That definitely works! Although you might want to provide the user some additional info in the dialog's description, because it's kind of confusing as it says Save as. They might question if it actually saves a file, what that file does, etc. Especially when they're expecting a selection dialog.
I'm not on Windows, but one would think the system has a setting for a 'normal' select folder dialog.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more