Programmatically move the mouse and push keys on keyboard

Question

How would I go about writing software that moves my mouse and pushes keys on my keyboard? Is there any framework out there that I can use? The following is an example of what I want to do. By no means is it the only thing I would do if I had the ability to programatically control my mouse and keyboard.

Example

Let’s say I was too stupid to download FFMPEG and write a shell script to make it take snapshots of my 100 or so videos (actually I am too stupid to even figure out how to download FFMPEG). However, I know very well how to use VLC’s GUI to type in the file I want and click the snapshot button. I just need to write a program to automate this for my 100 videos.