What I meant by "analyze the graphics" was: Suppose the program in question shows me one of 5 little pictures: say, parrot, dog, dolphin, elephant, and frog. I know exactly where in the program's window these pictures are displayed and there are only 5 possible pictures. My script needs to determine which animal is being shown (by, for example, taking the color of N pixels, with N around 5, i.e. large enough so that the colors uniquely determine the picture) and depending on the result click on one of several buttons in the program's window. Then the whole process repeats. Would I need to "kludge together an assortment of external utilities" for that or are all the required commands easily found in one or more of the scripting languages?

Also, as the next step, in actuality my script won't be able to decide which button to click on its own, but I have a program (call it Decider to distinguish it from the original program that i'm trying to control) that determines the button to click once it knows what animal is shown, so I want my script to determine the animal, then tell it to Decider, after which Decider would tell the script which button to click. At this level of complexity, are all the required commands readily available in one or more of the scripting languages? Which one would you use?