CS6+: The best way to get colors from art is to have your script run an action to create a new swatch group from selected art. You will get a new swatches group in your swatches panel, and they're going to be selected. At this point you can read the color swatches in whichever way you'd like, but you will have an extra group of swatches. You cannot very well delete this group because if you use any spot colors, they are going to be globally deleted from the entire document! You may want to run an immediately-following action to delete this swatch group or delete selected swatches, which harmlessly gets rid of the test group.
Still I cannot figure out other ways of getting the colors used in patterns.
Thanks, doScript works.