Sign in to follow this  
Followers 0
BlueScreen

Fileopendialog

5 posts in this topic

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



Have you looked at FileSelectFolder()?


[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

[center]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.[/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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  
Followers 0