As soon as I finished the script and came to the forum to make this post, I see that there’s another thread stickied already on how to do this with AutoHotKey… but oh well I will post my script anyway:
I came to this forum whining a long while back about how inconvenient RetroArch is with MAME at the moment (I know this is currently being thought through and worked out)… so I finally decided to just make my own script to do what I needed. I think it’s pretty handy, and gets the job done pretty fast. I put a few variables in there which can allow you to generate the playlist blindly (do or don’t check if the rom file exists), ignore dupes/clones, and also to specify a year range. (I personally only prefer the late 80’s and 90’s games)
Here are the directions from my readme. Let me know if you find it to be of any use!
Generate-MAME-Playlist-for-RetroArch
Grab the dat file appropriate to your own collection here: http://www.progettosnaps.net/dats/
Change the variables in the beginning of the PowerShell script as appropriate (most importantly pointing to the dat file that you just downloaded, and supplying correct ROM path/file extension). Be sure to review all of the variables here as some options will limit the number of ROMs that get added to the playlist. The default values may not be to your liking.
Run the script, then drop the generated playlist (.lpl file) into your playlist directory in RetroArch and you should be able to browse your games using the full ROM titles.