I found it after I posted this. It was answered in this thread
but if you dont want to look there, this is the long and short of it...
it is not opendialog. it is openDlg (how intuitive is that)
var myDefault = new Folder ("U:/xxx/zzz");
var myFiles = myDefault.openDlg(prompt string, filter string+pattern, multi-selection bollean);
I'm confused. That last one does not let you select a folder, it lets you select a file? 'Cause you initially asked
The how do you open a dialog to select a folder.
To select a folder, you can use either Folder.selectDialog or (folder object).selectDlg. There are a few (pretty vaguely described ) differences, but in general I don't care and use one of these:
// Generic form f = Folder.selectDialog("wot"); alert (f); // Pre-selected starting point folder = new Folder("/usr/bin"); f = folder.selectDlg("wot"); alert (f); // Pre-defined starting point folder = Folder.myDocuments; f = folder.selectDlg("wot"); alert (f);
But I tried the method I posted and it does let me select a folder. I haven't tried your method yet, although I am sure that they work as well since you haven't failed me yet.
But I can verify that what I posted does work in allowing me to select a folder from a dialog.
I actually have your CHM file open already, although I am working on trying to understand the Script UI stuff at the moment.
Strange. Possibly the File object gets silently promoted (or demoted) to a Folder through either the regular Object Descendent channels (whatever these may be), or because They made it do so on purpose ...
Yeah, I was just looking at Peters page before I opened yours. It gave me a lot of good information, but didn't give me an answer to what I was looking for.
Not to hijack my own thread, but maybe you can point me in the right direction regarding a Script UI since I have your ear.
Here is brief rundown of what I would like to do..
1. open a dialog window with two input fields and "browse" buttons, and an OK button
2. when you click the first button next to the first input field, it will open a file dialog window. You select your file and the file string will populate the input field
3. when you click the second button next to the second input field, it opens a folder dialog window. You select the folder and the string populates the second input field.
4. when you click OK, it feeds the values in the input field to a script.
I already have scripts to that open the file and folder dialogs, so the questions are:
1. can a dialog window created with Script UI open up another file dialog window
2. if yes to #1,how do you code a button in a dialog window to call and run a script
If you think this should go in another post, I'll do that.
Ah -- I always have a good time wrestling with ScriptUI myself, so no I wouldn't know off-hand how to do that. Did you try a custom 'onClick' handler for your Open File dialog? Peter's guide should contain a sample to show you how.
If you can't get it to work, create a new thread mentioning "ScriptUI" somewhere in the title -- that ought to get Peter's or one of the other ScriptUI wizzes's attention.
I will give the onCLick a try, but I feel a new thread in my future.