Here is a standalone script that will examine a pattern file to find all of the patterns (and their id's) in the .pat file.
The sample main at the bottom loops through all of the pattern files in Presets/Patterns and throws up an alert with the name of the file and the name and id of each pattern in the file.
Enjoy.