Jump to content
Sign in to follow this  
BlueScreen

Fileopendialog

Recommended Posts

BlueScreen

Hi,

Is there a way I can make force the user (using FileOpenDialog) to choose a file from 1 specific folder only and not to choose an other one ?

I know I can run an IF statement after the choose and extract the folder from the filename path, but is there a way to do it w/o the IF?

Thanks

Share this post


Link to post
Share on other sites
SmOke_N

Have you looked at FileSelectFolder()?


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
BlueScreen

Yes I have. But I want him to choose a FILE NOT a folde.

Share this post


Link to post
Share on other sites
SmOke_N

Yes I have. But I want him to choose a FILE NOT a folde.

No need for the caps, I misread the file part.

Edit:

Gary made a custom one I think a while back in the scripts and scraps forum... Other than specifying what and where the user starts at (with the current one) ie...

$Var = FileOpenDialog('Select A File From This Folder', @HomeDrive & '\MyFolder', 'Zip File Only (*.zip)', 1, 'MyZip.zip')
MsgBox(0, '', $Var)
I don't see how you can stop them from still surfing around. Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
MHz

I know I can run an IF statement after the choose and extract the folder from the filename path, but is there a way to do it w/o the IF?

FileOpenDialog changes the working directory, so use @WorkingDir after FileOpenDialog. Edited by MHz

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.