Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

A Better Folder Select Dialog.

Explorer ,
Nov 05, 2012 Nov 05, 2012

Folder.selectDialog('Select the folder to be imported');

dummerdialog.JPG

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.

saveAs.JPG

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.

TOPICS
Scripting
4.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Nov 08, 2012 Nov 08, 2012

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

...
Translate
Explorer ,
Nov 07, 2012 Nov 07, 2012

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 07, 2012 Nov 07, 2012

Thank You!

Very helpfull direction.  I am checking this out now.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 08, 2012 Nov 08, 2012

Did it actually open a different dialog?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 08, 2012 Nov 08, 2012

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 08, 2012 Nov 08, 2012

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 09, 2012 Nov 09, 2012
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines