I also wrote a helper script in Python that finds the Bates range of each PDF in a folder, stashes the original filename in the Finder comment metadata field, then applies a naming convention thats compatible with my AppleScript.
+1 simply for the rigor, beauty, and gusto. Perhaps when I eventually retire, I can test re-naming all my journal articles in BATES format just to give this fun-looking tool a whirl.
Yes, they’re generally Bates-numbered and stamped by the government agency. The PDF structure and filenaming convention varies significantly though. I wrote the script originally for documents that contain the Bates number in the filename, but in the mean time I’ve encountered Bates-numbered records where the filenames are simply document titles, hence the helper script that finds and adds Bates number range to the filename.