print "Generating histogram of focal lengths starting at $start, ending at $end, and with stepsize $delta in the directory $onlyin\n";
$commandstring="mdfind -onlyin $onlyin \"kMDItemFocalLength>=$flength && kMDItemFocalLength < $endbin) \" | wc -l";
Just copy and paste this (starting at the # mark and ending at the closing curly bracket) and save it in your Home folder as "flengthhistoscript.pl". You can call it in the following way:
perl flengthhistocript.pl 0 300 2.5 ~ > histo.dat
from your commandline (terminal.app), which will bin all files that have a defined focal length in your home folder (the tilde can be replaced by any folder you'd like) starting at a focal length of zero mm and ending at 300, with a 2.5 mm bin width. It saves the output in a text file called histo.dat. Here is an example of my Pictures folder plotted in Igor Pro, my favorite plotting program:
You can see that I tend to photograph on the short end. The big peak is in the bin 17.5 - 20mm, which is the short end of my standard kit lens (18mm), which tells me I should probably get myself a wider lens as I am constantly using it as short as possible. The peaks below it are my fisheye 10.5 mm and probably some images shot using Mariska's Point and shoot. One could adapt the above script quite easily to only give results for certain cameras, dates, locations, etc. as spotlight indexes all that info. Now go figure out your lens pattern!