How do I generate a list of the filenames of all images innserted in a project

My project has 500 images in it, all of which are inserted via Insert/Image Linked to File. I’m creating a coffee table book that includes the 500 images.

The graphic designer who is laying out the book in inDesign wants a single folder containing all of the images in the book, each numbered in sequence according the order in which they appear in the book. Ex.: Let’s say the book is about animals and it has 500 images of different animals. The current filenames are:

Monkey jumping.jpg
Elephant in pond.tif
Cat in tree.jpg

etc., all the way up to the final image:
Dog running.tif

I need to rename all of these files to:

1-Monkey jumping.jpg
2-Elephant in pond.tif
3-Cat in tree.jpg

etc., all the way up to the final image:
500-Dog running.tif

I need to rename all 500 image files, but I don’t want to do it manually by looking at each image in Scrivener, right-clicking to see the name of the image in the Finder, then renaming each file by hand. I want to use a renamer app that can rename files by looking at a CSV file that has 2 columns–all of the current filenames followed by all of the new filenames. I can create that CSV file quickly in Excel. I can tell the renamer app to automatically rename all 500 images based on the filenames contained in a CSV file,

So I create a compile format (saving to a TXT file), edited the format, selected “Markup” under “Section Layouts,” “Separators,” etc., and chose “replace images with text”: <$filename>

This generated a text file of the filenames, but for some reason it removed the spaces from all the names. Ex:
It created a text file with these names:


How can I get it to output the correct filename with all the existing spaces intact?

Alternatively, is there another way for me to extract all of the image filenames into a single document?