This content has been marked as final.
Show 3 replies
-
1. Re: How to make a dialog box for a user to choose a file from disk
Paul Riggott Oct 21, 2009 12:51 PM (in response to (MightyJack))Here is an example of selecting a text file...
var dlg= "dialog{text:'Script Interface',bounds:[100,100,500,220],"+ "testFile:EditText{bounds:[10,40,310,60] , text:'' ,properties:{multiline:false,noecho:false,readonly:false}},"+ "Browse:Button{bounds:[320,40,390,61] , text:'<<' },"+ "statictext0:StaticText{bounds:[10,10,240,27] , text:'Please select Text File' ,properties:{scrolling:undefined,multiline:undefined}},"+ "Process:Button{bounds:[10,80,190,101] , text:'Process' },"+ "button2:Button{bounds:[210,80,390,101] , text:'Cancel' }};" var win = new Window(dlg,'test'); win.center(); win.testFile.enabled=false; win.Browse.onClick = function() { selectedFile = File.openDialog("Please select TEXT file.","TEXT File:*.txt"); if(selectedFile != null) win.testFile.text = decodeURI(selectedFile.fsName); } win.Process.onClick = function() { if(win.testFile.text == '') { alert("No text file has been selected!"); return; } win.close(1); selectedFile.execute(); } win.show(); -
2. Re: How to make a dialog box for a user to choose a file from disk
Michael L Hale Oct 21, 2009 2:35 PM (in response to (MightyJack))Also unless you have some other need for the dialog you can skip it and just use
var selectedFile = File.openDialog("Please select TEXT file.","TEXT File:*.txt");
-
3. Re: How to make a dialog box for a user to choose a file from disk
(MightyJack) Oct 23, 2009 12:19 AM (in response to (MightyJack))Thank you for your help
Just what i was looking for.
/T

