I tryed looking if this was already publish, but when i used the search, 22 pages appeared, and i got bored at the second.... so anyway, here's the code:
FileSelectFolder, OutputVar, , 3, Folder Contents - Choose a folder if OutputVar = MsgBox, You didn't choose a folder. else MsgBox, You have chosen "%OutputVar%". Temp = C:\WINDOWS\TEMP Loop, %OutputVar%\*.*, 0, 0 { FileAppend, %A_LoopFileName%`n, %Temp%\FolderContents.txt } run, Notepad %Temp%\FolderContents.txt
The file is created in the windows\temp folder (assuming your hard drive is c: ), if not, that's the great thing about this, you can change it according to your needs. For example the save path, or if only lists mp3 or txt files.
Here's something i wanted to do:
I wanted the saved file to be called "name of the folder i choose" - FolderContents.txt
FileSelectFolder, OutputVar, , 3, Folder Contents - Choose a folder if OutputVar = MsgBox, You didn't choose a folder. else MsgBox, You have chosen "%OutputVar%". Temp = C:\WINDOWS\TEMP Loop, %OutputVar%\*.*, 0, 0 { FolderName = %A_LoopFileDir% FileAppend, %A_LoopFileName%`n, %A_LoopFileDir% - FolderContents.txt } run, Notepad %FolderName% - FolderContents.txt
But it saves the file one folder up, because thats the workin dir, given by %outputvar%.
So whenever i add the path %temp% to the loop, there is a problem with the path. The problems seems to be in the FileAppend function, here's the code: (it does not work) but try it:
FileSelectFolder, OutputVar, , 3, Folder Contents - Choose a folder if OutputVar = MsgBox, You didn't choose a folder. else MsgBox, You have chosen "%OutputVar%". Temp = C:\WINDOWS\TEMP Loop, %OutputVar%\*.*, 0, 0 { FolderName = %A_LoopFileDir% FileAppend, %A_LoopFileName%`n, %Temp%\%A_LoopFileDir% - FolderContents.txt } run, Notepad %Temp%\%FolderName% - FolderContents.txt
so i need to get the folder name without the path, i havent found it (yet) in the help file. Suggestions???