Alternative to FileSelectFolder, folder - No Gui

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mojobadshah
Posts: 25
Joined: 12 Nov 2019, 16:32

Alternative to FileSelectFolder, folder - No Gui

14 Feb 2020, 18:43

What path can I substitute for" FileSelectFolder, folder, etc..." in cases where I don't require a Gui to prompt me with an option to manually select a folder to loop through?
User avatar
lmstearn
Posts: 698
Joined: 11 Aug 2016, 02:32
Contact:

Re: Alternative to FileSelectFolder, folder - No Gui

15 Feb 2020, 21:15

Hi @mojobadshah :)
There's a resource shared by all processes in Windows, the Current Directory aka the AHK working directory, or A_WorkingDir. It can be changed at any time with SetWorkingDir. Is that what you are looking for?
:arrow: itros "ylbbub eht tuO kaerB" a ni kcuts m'I pleH
Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: Alternative to FileSelectFolder, folder - No Gui

16 Feb 2020, 03:22

Maybe I'm wrong, but it seems that you have a script that at every run it prompt you to select a folder and this annoys you.
If so, you can simply set a variable with the full path of the folder to loop through.
So instead of:

Code: Select all

FileSelectFolder, folder, c:\
Loop Files, %folder%\*.txt
{
    ....
}
You can use:

Code: Select all

folder := "the_full_path_of_your_folder"
Loop Files, %folder%\*.txt
{
    ....
}
; or even:
Loop Files, the_full_path_of_your_folder\*.txt
{
    ....
}
The advantage of using the FileSelectFolder is that, at every run, you can chose a different folder to loop through.

Hope this helps.
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: JKJadan, peter_ahk and 297 guests