Are there any tutorials on creating an export script?

I’ve been toying around with the notion of making a script that can export a model while keeping the armature deforms to the .x format so I can work with soft skin animations when I get the full version of 3D RAD, but I don’t even know where to begin. I’ve looked at export scripts, and I haven’t learned anything from them. How do you get it to export to a specific file type?