Skip to main content
Inspiring
February 18, 2022
Answered

Illustrator Folder.selectDialog

  • February 18, 2022
  • 2 replies
  • 1309 views

Hi

I have an Illustrator script for exporting artboards  as jpg

The problem is that the script "Folder.selectDialog" at illustrator  is different than the native "save for web" and very dificult to choose the desired folder.

The same "Folder.selectDialog" calling fron Photoshop script is different ( and easier to find the desired folder)

1) Native Illustrator > Export > Save for web 

 

2) Illustrator Script  "Folder.selectDialog"

 

 

3)Photoshop Script,   "Folder.selectDialog"

 

 

Any ideas if  illustrator "Folder.selectDialog' can be altered-improved ?

This topic has been closed for replies.
Correct answer Silly-V

You can try to do a fake file like this, which lets a user select a fake file to save to, and then use that file's parent, the folder?

var fakeFile = File("NAS/folder/thefile.psd");
var fakeFileChoice = fakeFile.saveDlg("Put any name, it doesn't matter, jsut pick a folder!");
if (fakeFileChoice) {

  alert(decodeURI(fakeFileChoice.parent.toString());

}

 

This may or may not work to bypass the undesirable native Select Folder dialog.

2 replies

Silly-V
Silly-VCorrect answer
Legend
February 18, 2022

You can try to do a fake file like this, which lets a user select a fake file to save to, and then use that file's parent, the folder?

var fakeFile = File("NAS/folder/thefile.psd");
var fakeFileChoice = fakeFile.saveDlg("Put any name, it doesn't matter, jsut pick a folder!");
if (fakeFileChoice) {

  alert(decodeURI(fakeFileChoice.parent.toString());

}

 

This may or may not work to bypass the undesirable native Select Folder dialog.

siomospAuthor
Inspiring
February 19, 2022

It works!

(without the decodeURI part) 

var fakeFile = File("//Fileserver/tempfolder/temp.jpg");
var fakeFileChoice = fakeFile.saveDlg("Put any name, it doesn't matter, jsut pick a folder!");
if (fakeFileChoice) {
  alert(fakeFileChoice.parent.toString();
}

changed the alert  to variable
var myFolder = fakeFileChoice.parent.toString();
Its a nice trick, but it will be so easier if the native folder dialog was like the file select dialog!
Thank you @Silly-V

Charu Rajput
Community Expert
Community Expert
February 18, 2022

Hi,

It can't be altered or modified as it is predefined.

It may differ in look from OS to OS or even app to app.

 

Best regards
siomospAuthor
Inspiring
February 18, 2022

Thank you for the info!

Unfortunately i cannot select my nas folders from this dialog...

"\\MYFILESSERVER2\files\"

With save for web, or from a photoshop script i can!