PDA

View Full Version : Control to select a directory?



FuriousGeorge
08-30-2004, 06:54 PM
Is there an LScript command that will open a browse for directory (instead of a browse for file) dialog box?

I've been pouring over the documentation, but I don't see anything for this.

Any help would be much appreciated.

faulknermano
08-31-2004, 04:09 AM
to my knowledge, no. are you aware of the technique wherein you use getfile() or ctlfilename with a "[none]" as the initial string? this effectively gets the path name. use split() to get the directory.

pazur
09-01-2004, 11:17 AM
I use a little trick:
- backup current content directory
- ask for content directory - You will get requester asking for dir only
- read new content - this is Your path
- restore backed up content

the only drawback is when You look at the requester it says "Select Content" or something like that.

FuriousGeorge
09-01-2004, 06:59 PM
Thank you both for your responses.

Forgive my ignorance, but how do you ask for a content directory? I don't see that in the documentation anywhere.

faulknermano
09-02-2004, 06:58 AM
Thank you both for your responses.

Forgive my ignorance, but how do you ask for a content directory? I don't see that in the documentation anywhere.

in layout:

CommandInput("ContentDirectory");

however i dont know to call that from lscript so that you can get the returned value. pazur?

FuriousGeorge
09-02-2004, 04:07 PM
Now that you pointed me in the right direction... it would look like this in Layout:


@warnings

generic
{
od = getdir(CONTENTDIR);
CommandInput("ContentDirectory");
nd = getdir(CONTENTDIR);
CommandInput("ContentDirectory " + od);
}




Unfortunately, I'm in Modeler and it doesn't work there. Still a useful trick though.

eFFeFFe
08-10-2007, 11:15 PM
With this trick, is it possible to detect if you pressed "ok" or "cancel" in the browse window, without checking the difference between the content directories ?

tnx,
eF.