PhotoGrok categorizes photos and other files by metadata (and a whole lot more). It's powered by Phil Harvey's excellent ExifTool. Java 6 or higher is required. Please read the FAQ and check out the scripting examples.
Version 2.41 features many new scripting features for automating functions and manipulating the display. See the new scripting page for details - including example code for adding a histogram.