a specific files such as an MP3 file and ignoring all other files in the folder.
any thoughts or suggestions, would be greatly appreciated,
I tried a couple of different settings, but just keep getting all the files in the folder,
when you execute the following,
Code: Select all
put listSortedFiles(currentFolder(), currentRecurse()) into field "Result"
Code: Select all
function listSortedFiles pFolder, pRecurse
local tFiles
put listFiles(pFolder, pRecurse) into tFiles
# HINT: Try using listFilesWithPaths() instead of listFiles() to return full path of each file.
# Try changing the listSortedFileSortKey() function to customize how files are sorted.
sort lines of tFiles by listSortedFilesSortKey(each)
return tFiles
end listSortedFiles
# Used by the listSortedFiles() function. Returns a sort key from each file's name to
# allow the sorting to be fully customized. There are three possible options already
# given here, try commenting out the first / second options to see the others working.
function listSortedFilesSortKey pFile
# Use this value for a normal text sort
return pFile
# Use this value to sort on the entire path
return the directory & slash & pFile
# Use this value to sort by extension
local tExtension
set the itemDelimiter to "."
put item -1 of pFile into tExtension
set the itemDelimiter to comma
return tExtension
end listSortedFilesSortKey