Create a list of Colors. What colors where do you get the colors you want in the list CSV. You could for example use Photoshop color sample tool to select up to 10 color at a time then use a Script to build a Script custom option where the colors are stored. When the Script accumulate 256 color option it could create a CSV file or perhaps convert the current document into index color using the custom option data. I have never scripted create anything like a index color table. The Script would also need to be able to reset the custom Script Option back to empty like test if a modify key is press and reset the custom option. I'm not sure a custom script option can be use this way It may be for the option is basically an action descriptor. So I think it may be possible but I have little knowledge about Action Manager Code.