Jump to content
Sign in to follow this  
faire

FileSelectFolder only if valid directory

Recommended Posts

faire

Is it possible to only allow the selection of a direrectory [through FileSelectFolder] if a certain file is present (so the "Open" button stays grayed out until a valid directory has been selected; that being a directory where said file is present)?

Edited by faire

Share this post


Link to post
Share on other sites
faire

*bump*

I'm now checking if the directory is valid in another function. Still it would be interesting to know if anyone has an answer to this question. It'd be a nice feature in my opinion.

Share this post


Link to post
Share on other sites
MerkurAlex

*bump*

I'm now checking if the directory is valid in another function. Still it would be interesting to know if anyone has an answer to this question. It'd be a nice feature in my opinion.

You would have to recreate the gui yourself as i believe that function pauses the wholes script stopping you from disabling the button or re-enabling it this is the only solution i see other than have two scripts do it one runs that function the other watches and disables then enables the button.

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites
rasim

Is it possible to only allow the selection of a direrectory [through FileSelectFolder] if a certain file is present (so the "Open" button stays grayed out until a valid directory has been selected; that being a directory where said file is present)?

You can check a selected folder validation after choosing, e.g.:

Do
    $SelectFolder = FileSelectFolder("Choose a folder...", "", 0, @DesktopDir)
Until StringInStr($SelectFolder, @DesktopDir) > 0

MsgBox(0, "", $SelectFolder)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.