1. Use the Mac Terminal
To use the terminal, open Terminal (applications>utilities) on your Mac, navigate to the folder you want to make a text file out of the file names in the folder, then type:
ls -R > contents.txt
This command lists all files in the current folder and its subfolders. That file is then placed in the current folder. Hidden files can also be added to the listing with:
ls -a -R > contents.txt
Open TextWrangler. Create a new blank file. In the Edit menu, select Insert / Folder Listing…
Navigate to the folder you want the file name listing from, then select it. All subfolders will be added, too.