I’m not able to find this information in any of the .plist files contained within the app bundle, and I’m not sure if there’s a way to query some sort of application registry the way you can query ioreg to get at the information reported by System Report.
This seems to be examining metadata of the binaries somehow, which might not be easy without running an actual command like this unless there is an existing inspector for this, or there is an easy way to read it in the binary.
If the info is in IOReg, that would work. It seems like System Report is getting this info stored somewhere specifically. If we knew how to read that location directly, then that would be an option as well.
Might work on this more later to have it spit out versions of the apps too, but for now this is a quick and easy way to parse that file into an analysis property (assuming you only care about .apps)
unique values of following texts of lasts "/" of lines containing ".app" of files "/tmp/results_mdfind_i386.log"
Or maybe this is a little better?
unique values of following texts of lasts "/Applications/" of lines containing ".app" of files "/tmp/results_mdfind_i386.log"