Well I realised I was being dumb about the open buttons for folder and files (whilst I'm looking for file names I'm still looking at file names within a folder). I've expanded it so that now it lets you choose whether to get a list of files or folders and if you select files you can either get a list of all files or enter the extension you want.
The only bit I want to fix is to remove the path from the folder/file names that are pasted into notepad.
Code: Select all
Ask>Select Yes for Folders No for Files,strResponse
If>strResponse=YES
GoSub>folder
Else
GoSub>file
Endif
Srt>folder
Let>INPUT_BROWSE=2
Input>folder_result,Please Select The Root Folder,
IF>folder_result=
Exit>0
EndIF
Let>GFL_TYPE=1
GetFileList>%folder_result%\*.*,folders
Separate>folders,;,folder_names
RunProgram>C:\Windows\System32\notepad.exe
WaitWindowOpen>Untitled - Notepad
Let>k=0
Repeat>k
Let>k=k+1
PutClipBoard>folder_names_%k%
Press>Ctrl
Send>>v
Release>Ctrl
Press>Enter
Until>k=folder_names_count
END>folder
srt>file
Let>INPUT_BROWSE=0
Input>FileFormat,Please enter the 3 character file format e.g wav. Enter 0 for all files,0
IF>FileFormat=
Exit>0
EndIF
If>FileFormat=0
GoSub>all_files
Else
Let>INPUT_BROWSE=2
Input>file_result,Please Select The Folder Containing The Files
IF>file_result=
Exit>0
EndIF
GetFileList>%file_result%\*.%FileFormat%,FormatFileList
Separate>FormatFileList,;,file_names
RunProgram>C:\Windows\System32\notepad.exe
WaitWindowOpen>Untitled - Notepad
SetFocus>Untitled - Notepad
Let>k=0
Repeat>k
Let>k=k+1
PutClipBoard>file_names_%k%
Press>Ctrl
Send>>v
Release>Ctrl
Press>Enter
Until>k=file_names_count
endif
Srt>all_files
Let>INPUT_BROWSE=2
Input>file_result,Please Select The Folder Containing The Files
If>file_result=
Exit>0
GetFileList>%file_result%\*.*,files
Separate>files,;,file_names
RunProgram>C:\Windows\System32\notepad.exe
WaitWindowOpen>Untitled - Notepad
Setfocus>Untitled - Notepad
Let>k=0
Repeat>k
Let>k=k+1
PutClipBoard>file_names_%k%
Press>Ctrl
Send>>v
Release>Ctrl
Press>Enter
Until>k=file_names_count
END>all_files
END>file
So lets say I have a folder on the root of the C: drive called My Folder and inside that were 5 txt files called 1,2,3,4,5
At the moment the text pasted into Notepad will be:
C:\My Folder\1.txt
C:\My Folder\2.txt
C:\My Folder\3.txt
C:\My Folder\4.txt
C:\My Folder\5.txt
Instead I just want:
1.txt
2.txt
3.txt
4.txt
5.txt
The same would apply for folders.