I have a dialogue box that allows the user to browse for one PSD file and then to browse for multiple TIF files. When browsing for multiple TIF files, the text in the edittext box comes out as undefined. Where as, if I just remove the ability to select multiple files, it works.
var dlg = new Window('dialog', 'PSD Creator', [100, 100, 500, 550] );
dlg.pnl_browse = dlg.add('panel', [10, 10, 390, 150], 'Browse');
dlg.pnl_browse.txt_staticPSD = dlg.pnl_browse.add('statictext' , [15, 10, 375, 30],'Select the project images folder:');
dlg.pnl_browse.btn_browsePSD = dlg.pnl_browse.add ('button', [15, 35, 60, 60], '...');
dlg.pnl_browse.txt_editPSD = dlg.pnl_browse.add('edittext' , [65, 35, 365, 55],'<Select the project images folder>');
dlg.pnl_browse.txt_staticTIFF = dlg.pnl_browse.add('statictext' , [15, 70, 375, 90],'Select the folder where you TIFF images are:');
dlg.pnl_browse.btn_browseTIFF = dlg.pnl_browse.add ('button', [15, 95, 60, 120], '...');
dlg.pnl_browse.txt_editTIFF = dlg.pnl_browse.add('edittext' , [65, 95, 365, 120],'<Select the folder where you TIFF images are>');
dlg.btn_ok = dlg.add ('button', [70,400,190,430], 'ok');
dlg.btn_cancel = dlg.add ('button', [210,400,320,430], 'cancel');
dlg.pnl_browse.btn_browsePSD.onClick = function () {
selectFilePSD = File.openDialog("Please select your template file.","*.psd");
if(selectFilePSD != null) dlg.pnl_browse.txt_editPSD.text = decodeURI(selectFilePSD.fsName);
}
dlg.pnl_browse.btn_browseTIFF.onClick = function () {
selectFileTIFF = File.openDialog("Please select your tiff images.","*.TIF; *TFF", true);
if(selectFileTIFF != null) dlg.pnl_browse.txt_editTIFF.text = decodeURI(selectFileTIFF.fsName);
}
dlg.btn_ok.onClick = function () {
dlg.close()
open (selectFilePSD);
open (selectFileTIFF);
}
dlg.center();
dlg.show();