Here is a custom function you can use to generate a list of all the locations of any file you enter as the parameter. The file should include the file extension along with the file name. Without using the file extension you could end up with a whole bunch of unexpected files added to the output. If you simply use “” as the file name it will gather the info for the current database.
||| mdfind “kMDItemFSName=’|||+?(•1=”",info(“databasefilename”),•1)+|||’"|||)
After running the above registration code you can use the
locatefiles( function simply like this:
This will produce a list of all locations of my images.gif file on my system arranged in chronological order like this:
This method uses the same indexed file database as Spotlight. A shellscript( using mdfind gets the list of all the file paths then an arrayfilter( adds on the superdate of the last date the file was modified for each file followed by an arraynumericsort( to get them in chronological order with a final arrayfilter( to convert the superdates to a text pattern with the date and time last modified.
It was interesting how it turned up some long forgotten backup copies of various files including some old Panorama TimeLapse versions.