Re: list of colors in a file
This not what you are looking for, but it may be a step closer to what you need.
I noticed today, using Photoshop CS4, when I was saving my images for the web that there is a color table that shows every single color that existed in the image I was saving.
To do this I did the shortcut for saving a file for web Ctrl+Alt+Shift+s and then you should see the color table on the window that pops up. From there you can save the color table (saves as an .act file) and if you could somehow find a way to convert the file to something excel or a text editor could read then you might have what you need.
Hopefully you can find a way to get what you need!