Jump to content

Fileopendialog


Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...