function recurDir dir, ext set the defaultFolder to dir repeat for each line fi in the files if fileExt(fi) = ext then put the longfilepath of fi & cr after fileList end if end repeat repeat for each line di in the folders if di is not "." and di is not ".." then put recurDir((dir & slash & di), ext) & cr after fileList end if end repeat filter fileList without empty return fileList end recurDir function fileExt f set the itemdel to "." return the last item of f end fileExt