rraallvv
rraallvv

Reputation: 2933

Dialog to pick a file name like in the "Save As" dialog in Photoshop script

Is there an API to show a dialog that allows the user to browse/create folders and either pick an already existing file or enter the name for a new one in order to save some metadata.

Something like the "Save As" dialog in Photoshop but without actually saving anything, but just retrieve the path and filename entered by the user.

enter image description here

enter image description here

Upvotes: 0

Views: 674

Answers (1)

Ghoul Fool
Ghoul Fool

Reputation: 6949

Not sure about a specific API, but is this the sort of thing you're looking for?

var inFolder = Folder.selectDialog("Please select folder to process");
if (inFolder != null)
{
    var fileList = inFolder.getFiles(/\.(png)$/i);
}

or

 var filterFiles = 'CSV:*.csv'; // I am windows
 theFile = File.openDialog ("Choose the CSV file to load from" , filterFiles);

Whereas you can reference theFile or fileList to get the file or path you're after.

Upvotes: 1

Related Questions