用于选择文件名的对话框,如Photoshop脚本中的“另存为”对话框

时间:2016-12-25 00:24:02

标签: photoshop photoshop-script

是否有API显示一个对话框,允许用户浏览/创建文件夹,然后选择一个已存在的文件或输入新文件的名称以保存一些元数据。

像Photoshop中的“另存为”对话框,但没有实际保存任何内容,只是检索用户输入的路径和文件名。

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:1)

不确定特定的API,但这是您正在寻找的那种东西吗?

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

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

您可以引用文件或文件列表来获取您之后的文件或路径。