Page 1 of 1

Use FileSelectFile to select Folder?

Posted: 02 Jul 2019, 08:17
by SirSocks
Hello -

How can I uses FileSelectFile to select a folder?
I do not want to use the FileSelectFolder function as I don’t like the default user interface.
This is what I’m using so far, but It’s not working.

Code: Select all

FileSelectFile, SelectedFolder, 2, %a_workingdir% , Select a folder ,folder(_)
msgbox The Path you selected is %SelectedFolder%
return

All help is appreciated,
Thank you.

Re: Use FileSelectFile to select Folder?

Posted: 02 Jul 2019, 10:36
by hd0202
Have a look at

Code: Select all

FileSelectFolder
Hubert

Re: Use FileSelectFile to select Folder?

Posted: 02 Jul 2019, 13:21
by toralf
What exactly doesn”t work?
What is the result and what is what you expect?

Re: Use FileSelectFile to select Folder?

Posted: 02 Jul 2019, 13:58
by Flipeador

Re: Use FileSelectFile to select Folder?

Posted: 02 Jul 2019, 15:20
by flyingDman
This code here https://github.com/flipeador/Library-AutoHotkey/blob/master/dlg/ChooseFolder.ahk works but needs a tweak. The function Direxist needs to be replaced by Fileexist in all places. But then running:

Code: Select all

msgbox % ChooseFolder(Owner)
works (though it seems a bit slow). This was included in a post mentioned by @Flipeador .

Re: Use FileSelectFile to select Folder?

Posted: 02 Jul 2019, 15:48
by Flipeador
@flyingDman All my code in GitHub is written for AHKv2. If he uses v1, he must use the code I posted in the post in the link I put above.

Re: Use FileSelectFile to select Folder?

Posted: 02 Jul 2019, 16:00
by flyingDman
I see. Well I now also see that there is a direxist function.

Code: Select all

DirExist(DirName)
{
    loop Files, % DirName, D
        return A_LoopFileAttrib
}
I did not intend to convert a v2 script back to v1. My confusion. Apologies.

Re: Use FileSelectFile to select Folder?

Posted: 02 Jul 2019, 16:28
by SirSocks
Thanks everyone for the help so far. I'll take a closer look at all that and see what one will work best for me.
By the way I'm using AHK version V1.1.30